forked from aesthernr/quectel-rgmii-simpleadmin
-
Notifications
You must be signed in to change notification settings - Fork 8
/
uninstall_on_modem.sh
49 lines (36 loc) · 1.11 KB
/
uninstall_on_modem.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
#!/bin/bash
#
# Removes SimpleAdmin
#
read -p "Do you want to uninstall SimpleAdmin (yes/no) " yn
case $yn in
yes ) echo ok, we will proceed;;
no ) echo exiting...;
exit;;
* ) echo invalid response;
exit 1;;
esac
# ExecStop
systemctl stop simpleadmin_generate_status.timer
systemctl stop simpleadmin_generate_status
systemctl stop simpleadmin_httpd
systemctl stop ttl-override
#Remove from /usrdata
rm -rf /usrdata/simpleadmin
# Remount
mount -o remount,rw /
# Copy systemd init files & reload
#remove links
rm /lib/systemd/system/multi-user.target.wants/simpleadmin_httpd.service
rm /lib/systemd/system/multi-user.target.wants/simpleadmin_generate_status.service
rm /lib/systemd/system/timers.target.wants/simpleadmin_generate_status.timer
rm /lib/systemd/system/multi-user.target.wants/ttl-override.service
#remove files
rm /lib/systemd/system/simpleadmin_generate_status.timer
rm /lib/systemd/system/simpleadmin_httpd.service
rm /lib/systemd/system/simpleadmin_generate_status.service
rm /lib/systemd/system/ttl-override.service
systemctl daemon-reload
# Link systemd files
# Remount readonly
mount -o remount,ro /