forked from happycodinguk/telegram-system-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
84 lines (46 loc) · 1.79 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
84
#!/bin/bash
# This script will uninstall the scripts and services!
read -e -p "
##################################################
Which path did you install the scripts in???
Enter For DEFAULT LOCATION:
/usr/local/scripts/custom-monitor-tgm
##################################################
Filepath:" inspath
: ${inspath:=/usr/local/scripts/custom-monitor-tgm}
echo "You entered $inspath"
#####################################################################
# Dont Edit below here !!!!!!!!!
#####################################################################
systemctl stop storage-warn-tgm.service
systemctl disable storage-warn-tgm.service
systemctl stop storage-warning.timer
systemctl disable storage-warning.timer
systemctl stop postfix-report.service
systemctl disable postfix-report.service
systemctl stop postfix-report.timer
systemctl disable postfix-report.timer
systemctl stop system-warn-tgm.service
systemctl disable system-warn-tgm.service
systemctl stop cpu-mem-alert.service
systemctl disable cpu-mem-alert.service
systemctl stop csf-lfd-alert.service
systemctl disable csf-lfd-alert.service
systemctl daemon-reload
#Remove installed scripts
rm -frv $inspath
rm -fr /tmp/tg_install
#systemctl remove services
rm -frv /etc/systemd/system/storage-warn-tgm.service
rm -frv /etc/systemd/system/storage-warning.timer
rm -frv /etc/systemd/system/system-warn-tgm.service
rm -frv /etc/systemd/system/cpu-mem-alert.service
rm -frv /etc/systemd/system/postfix-report.service
rm -frv /etc/systemd/system/postfix-report.timer
rm -frv /etc/systemd/system/csf-lfd-alert.service
# Remove SSH Warning link in /etc/pam.d/sshd if it exists
sed -i '/ssh-login-warning.sh/d' /etc/pam.d/sshd
read -e -p "
Removed SSH Warning link in /etc/pam.d/sshd if it exists
UNINSTALL COMPLETE"
exit 0