1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/bin/bash
# Check if root
SUDO=''
if [ $EUID -ne 0 ]; then
SUDO='sudo'
fi
echo
echo "UNINSTALLING Writer..."
echo "======================"
echo
ERRORS=0
# Remove executable
echo 'Removing /usr/bin/writer'
$SUDO rm /usr/bin/writer
if [ $? -ne 0 ]; then
ERRORS=$ERRORS + 1
fi
# Remove .desktop
echo 'Removing /usr/share/applications/writer.desktop'
$SUDO rm /usr/share/applications/writer.desktop
if [ $? -ne 0 ]; then
ERRORS=$ERRORS + 1
fi
if [ $ERRORS -eq 0 ]; then
echo
echo 'Writer successfully uninstalled!'
echo 'Please log out and back in again for the changes to take effect'
exit 0
else
echo
echo 'Writer was NOT uninstalled successfully!'
echo "$ERRORS errors occurred!"
exit 1
fi
|