-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·95 lines (73 loc) · 1.53 KB
/
uninstall.sh
File metadata and controls
executable file
·95 lines (73 loc) · 1.53 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
# this is a hack
export INSTALL_PATH=/usr
export LOG_PATH=/var/log/pop
export ETC_PATH=/etc
export USER=cmsprod
export PYTHONPATH=/usr/lib/python2.6/site-packages
export SOURCE=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
### Stop the daemons first ###
if [[ $(uname -r) =~ el7 ]]
then
systemctl stop popd 2>/dev/null
else
service popd stop 2>/dev/null
fi
echo
echo "Uninstalling pop based on $SOURCE."
echo
echo '#########################'
echo '###### LIBRARIES ######'
echo '#########################'
echo
echo "-> Uninstalling.."
### Install the python libraries ###
rm -rf $PYTHONPATH/pop
### Install the executable(s) ###
pop_files=`ls -1 $SOURCE/sbin`
for file in $pop_files
do
rm -f $INSTALL_PATH/sbin/$file
done
pop_files=`ls -1 $SOURCE/bin`
for file in $pop_files
do
rm -f $INSTALL_PATH/bin/$file
done
echo " Done."
echo
### Install the configs ###
echo
echo '########################'
echo '###### CONFIGS #######'
echo '########################'
echo
echo "-> Uninstalling.."
rm -f $ETC_PATH/pop.cfg
echo " Done."
echo
echo
echo '#########################'
echo '###### LOGFILES #######'
echo '#########################'
echo
echo "-> Uninstalling.."
rm -rf $LOG_PATH
echo " Done."
echo
### Install the daemons ###
echo '########################'
echo '###### SERVICES ######'
echo '########################'
echo
echo "-> Uninstalling.."
if [[ $(uname -r) =~ el7 ]]
then
# systemd daemon
rm /usr/lib/systemd/system/popd.service
systemctl daemon-reload
else
rm /etc/init.d/popd
fi
echo " Done."
echo