forked from FanhuaCloud/AliYunServicesClear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
98 lines (80 loc) · 2.39 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
function Colorset() {
#颜色配置
echo=echo
for cmd in echo /bin/echo; do
$cmd >/dev/null 2>&1 || continue
if ! $cmd -e "" | grep -qE '^-e'; then
echo=$cmd
break
fi
done
CSI=$($echo -e "\033[")
CEND="${CSI}0m"
CDGREEN="${CSI}32m"
CRED="${CSI}1;31m"
CGREEN="${CSI}1;32m"
CYELLOW="${CSI}1;33m"
CBLUE="${CSI}1;34m"
CMAGENTA="${CSI}1;35m"
CCYAN="${CSI}1;36m"
CSUCCESS="$CDGREEN"
CFAILURE="$CRED"
CQUESTION="$CMAGENTA"
CWARNING="$CYELLOW"
CMSG="$CCYAN"
}
function Logprefix() {
#输出log
echo -n ${CGREEN}'CraftYun >> '
}
function Uninstall() {
Logprefix;echo ${CYELLOW}'[INFO]Uninstall AliYun services!'${CEND}
rm -rf /usr/sbin/aliyun*
service cloudmonitor stop
service aegis stop
service agentwatch stop
rm -rf /usr/local/share/aliyun-assist/
rm -rf /usr/local/aegis
rm -rf /usr/local/cloudmonitor
systemctl stop aliyun.service
rm -rf /etc/systemd/system/aliyun.service
systemctl daemon-reload
rm -rf /etc/init.d/agentwatch
rm -rf /etc/init.d/aegis
rm -rf /etc/init.d/cloudmonitor
rm -rf /etc/rc.d/rc0.d/K01agentwatch
rm -rf /etc/rc.d/rc0.d/K80cloudmonitor
rm -rf /etc/rc.d/rc1.d/K01agentwatch
rm -rf /etc/rc.d/rc1.d/K80cloudmonitor
rm -rf /etc/rc.d/rc2.d/S20cloudmonitor
rm -rf /etc/rc.d/rc2.d/S50aegis
rm -rf /etc/rc.d/rc2.d/S80aegis
rm -rf /etc/rc.d/rc2.d/S98agentwatch
rm -rf /etc/rc.d/rc3.d/S20cloudmonitor
rm -rf /etc/rc.d/rc3.d/S50aegis
rm -rf /etc/rc.d/rc3.d/S80aegis
rm -rf /etc/rc.d/rc3.d/S98agentwatch
rm -rf /etc/rc.d/rc4.d/S20cloudmonitor
rm -rf /etc/rc.d/rc4.d/S50aegis
rm -rf /etc/rc.d/rc4.d/S80aegis
rm -rf /etc/rc.d/rc4.d/S98agentwatch
rm -rf /etc/rc.d/rc5.d/S20cloudmonitor
rm -rf /etc/rc.d/rc5.d/S50aegis
rm -rf /etc/rc.d/rc5.d/S80aegis
rm -rf /etc/rc.d/rc5.d/S98agentwatch
rm -rf /etc/rc.d/rc6.d/K01agentwatch
rm -rf /etc/rc.d/rc6.d/K80cloudmonitor
Logprefix;echo ${CMSG}'[SUCCESS]Uninstall AliYun services success!'${CEND}
Logprefix;echo ${CYELLOW}'[INFO]Install wget!'${CEND}
yum -y install wget
Logprefix;echo ${CYELLOW}'[INFO]Uninstall AliYun aegis!'${CEND}
wget http://update.aegis.aliyun.com/download/uninstall.sh -O /tmp/uninstall.sh
chmod +x /tmp/uninstall.sh
/tmp/uninstall.sh
rm -rf /tmp/uninstall.sh
Logprefix;echo ${CMSG}'[SUCCESS]Uninstall AliYun aegis success!'${CEND}
Logprefix;echo ${CYELLOW}'[INFO]Uninstall success.Please reboot.'${CEND}
}
Colorset
Uninstall