summaryrefslogtreecommitdiff
path: root/tools/afterremove.sh
blob: 1eaa14c77b5a03bef3365d3f59c4cf4c2a71c39c (plain)
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
#!/bin/bash
if [ 0 -eq $1 ];then

	echo 'start remove nz-agent  from disk...'

	systemctl stop nz-agent.service
	systemctl stop prometheus.service
	systemctl stop snmp-exporter.service
	systemctl stop blackbox-exporter.service
	systemctl stop cortex.service
	systemctl stop loki.service

	rm -rf /opt/nezha/nz-agent

	systemctl disable nz-agent.service
	systemctl disable prometheus.service
	systemctl disable snmp-exporter.service
	systemctl disable blackbox-exporter.service
	systemctl disable cortex.service
	systemctl disable loki.service
	rm -rf /usr/lib/systemd/system/{nz-agent.service,prometheus.service,snmp-exporter.service,blackbox-exporter.service,cortex.service,loki.service}

	systemctl daemon-reload

	echo 'uninstall success!'
fi