forked from lmammino/cube-daemons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
executable file
·75 lines (50 loc) · 1.03 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
#!/bin/bash
#should be run as sudo
if [ "$UID" -ne 0 ]
then echo "WARNING: it seems that the uninstaller has not be run as root. It may not work as intended."
fi
# stopping daemons
cat << EOF
-------------------
1. Stopping daemons
-------------------
EOF
/etc/init.d/cube-collector stop
/etc/init.d/cube-evaluator stop
#removing scripts
cat << EOF
------------------------------
2. Removing start/stop scripts
------------------------------
EOF
rm /etc/init.d/cube-collector
rm /etc/init.d/cube-evaluator
update-rc.d cube-collector remove
update-rc.d cube-evaluator remove
#removing cube run dir (for pid files)
cat << EOF
--------------------------------
3. Removing /var/run/cube folder
--------------------------------
EOF
rm -rf /var/run/cube
#Removing cube user and group
cat << EOF
---------------------
4. Removing cube user
---------------------
EOF
userdel cube
groupdel cube
#Uninstall cube
cat << EOF
-----------------
4. Uninstall cube
-----------------
EOF
npm uninstall -g cube
# Exit
cat << EOF
Done.
EOF
exit 0