-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·100 lines (78 loc) · 2.06 KB
/
uninstall.sh
File metadata and controls
executable file
·100 lines (78 loc) · 2.06 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
96
97
98
99
100
#!/bin/bash
echo "Uninstalling dynamo."
export SOURCE=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
### Read the config ###
INSTALL_CONF=$1
[ -z "$INSTALL_CONF" ] && INSTALL_CONF=$SOURCE/dynamo.cfg
if ! [ -e $INSTALL_CONF ]
then
echo
echo "$INSTALL_CONF does not exist."
exit 1
fi
source $SOURCE/utilities/shellutils.sh
READCONF="$SOURCE/utilities/readconf -I $INSTALL_CONF"
INSTALL_PATH=$($READCONF paths.dynamo_base)
CONFIG_PATH=$($READCONF paths.config_path)
ARCHIVE_PATH=$($READCONF paths.archive_path)
SPOOL_PATH=$($READCONF paths.spool_path)
LOG_PATH=$($READCONF paths.log_path)
CLIENT_PATH=$($READCONF paths.client_path)
WEBSERVER=$($READCONF web.enabled)
FILEOP=$($READCONF file_operations.enabled)
### Delete files ###
if [[ $(uname -r) =~ el7 ]]
then
systemctl stop dynamod
systemctl disable dynamod
rm /usr/lib/systemd/system/dynamod.service
rm /etc/sysconfig/dynamod
else
service dynamod stop
chkconfig dynamod off
rm /etc/init.d/dynamod
fi
FILEOP_BACKEND=$($READCONF file_operations.backend)
if [ "$FILEOP" = "true" ] && [ "$FILEOP_BACKEND" = "standalone" ]
then
if [[ $(uname -r) =~ el7 ]]
then
systemctl stop dynamo-fileopd
systemctl disable dynamo-fileopd
rm /usr/lib/systemd/system/dynamo-fileopd.service
rm /etc/sysconfig/dynamo-fileopd
else
service dynamo-fileopd stop
chkconfig dynamo-fileopd off
rm /etc/init.d/dynamo-fileopd
fi
fi
rm -rf $INSTAL_PATH
rm -rf $SPOOL_PATH
for FILE in dynamo dynamo-inject dynamo-request
do
rm $CLIENT_PATH/dynamo
done
for FILE in dynamod dynamo-exec-auth dynamo-fileopd dynamo-user-auth
do
rm $SYSBIN_PATH/$FILE
done
for PYPATH in $(python -c 'import sys; print " ".join(sys.path)')
do
if [[ $PYPATH =~ ^/usr/lib/python.*/site-packages$ ]]
then
rm -rf $PYPATH/dynamo
break
fi
done
# NRPE PLUGINS
if [ -d /usr/lib64/nagios/plugins ]
then
rm /usr/lib64/nagios/plugins/check_dynamo.sh
fi
echo "The following elements are not deleted:"
echo " . DB tables"
echo " . $CONFIG_PATH"
echo " . $LOG_PATH"
echo " . $ARCHIVE_PATH"
echo " . crontab (if any entries were made)"