-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathuninstall.sh
executable file
·83 lines (75 loc) · 2.31 KB
/
uninstall.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
########################################################################
# author: Jefferson González <[email protected]> #
# copyright: 2015 Jefferson González #
# #
# This file is part of WatchSys, which is under the GPLv3 License. #
# See the LICENSE file or visit <http://www.gnu.org/licenses/> #
########################################################################
clear
echo "Uninstalling WatchSys"
if [ -e '/etc/init.d/watchsys' ]; then
echo; echo -n "Deleting init service..."
UPDATERC_PATH=`whereis update-rc.d`
if [ "$UPDATERC_PATH" != "update-rc.d:" ]; then
service watchsys stop > /dev/null 2>&1
update-rc.d watchsys remove > /dev/null 2>&1
fi
rm -f /etc/init.d/watchsys
echo -n ".."
echo " (done)"
fi
if [ -e '/usr/lib/systemd/system/watchsys.service' ]; then
echo; echo -n "Deleting systemd service..."
SYSTEMCTL_PATH=`whereis update-rc.d`
if [ "$SYSTEMCTL_PATH" != "systemctl:" ]; then
systemctl stop watchsys > /dev/null 2>&1
systemctl disable watchsys > /dev/null 2>&1
fi
rm -f /usr/lib/systemd/system/watchsys.service
echo -n ".."
echo " (done)"
fi
echo -n "Deleting script files..."
if [ -e '/usr/lib/watchsys' ]; then
rm -rf /usr/lib/watchsys
echo -n "."
fi
if [ -e '/usr/bin/watchsys' ]; then
rm -f /usr/bin/watchsys
echo -n "."
fi
if [ -e '/usr/share/doc/watchsys' ]; then
rm -rf /usr/share/doc/watchsys
echo -n "."
fi
if [ -e '/var/cache/watchsys' ]; then
rm -rf /var/cache/watchsys
echo -n "."
fi
if [ -e '/etc/logrotate.d/watchsys' ]; then
rm -rf /etc/logrotate.d/watchsys
echo -n "."
fi
if [ -e '/var/log/watchsys.log' ]; then
rm -rf /var/log/watchsys.*
echo -n "."
fi
echo " (done)"
echo -n "Removing man page..."
if [ -e '/usr/share/man/man1/watchsys.1' ]; then
rm -f /usr/share/man/man1/watchsys.1
echo -n "."
fi
if [ -e '/usr/share/man/man1/watchsys.1.gz' ]; then
rm -f /usr/share/man/man1/watchsys.1.gz
echo -n "."
fi
echo " (done)"
if [ -e '/etc/cron.d/watchsys' ]; then
echo -n "Deleting cron job..."
rm -f /etc/cron.d/watchsys
echo -n ".."
echo " (done)"
fi
echo; echo "Uninstall Complete!"; echo