-
Notifications
You must be signed in to change notification settings - Fork 25
/
argon-uninstall.sh
executable file
·76 lines (60 loc) · 1.61 KB
/
argon-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
#!/bin/bash
echo "----------------------"
echo " Argon Uninstall Tool"
echo "----------------------"
echo -n "Press Y to continue:"
read -n 1 confirm
echo
if [ "$confirm" = "y" ]
then
confirm="Y"
fi
if [ "$confirm" != "Y" ]
then
echo "Cancelled"
exit
elif [ "$EUID" -ne 0 ]; then
echo "Please run as root / use sudo"
exit
fi
find /home/ -name argonone-config.desktop -type f -delete
rm /usr/share/pixmaps/ar1config.png 2> /dev/null
rm /usr/share/pixmaps/argoneon.png 2> /dev/null
INSTALLATIONFOLDER=/etc/argon
argononefanscript=$INSTALLATIONFOLDER/argononed.py
if [ -f $argononefanscript ]; then
systemctl stop argononed.service
systemctl disable argononed.service
# Turn off the fan
/usr/bin/python3 $argononefanscript FANOFF
# Remove files
rm /lib/systemd/system/argononed.service
fi
# Remove RTC if any
argoneonrtcscript=$INSTALLATIONFOLDER/argoneond.py
if [ -f "$argoneonrtcscript" ]
then
# Disable Services
systemctl stop argoneond.service
systemctl disable argoneond.service
# Shutdown realtime clock
/usr/bin/python3 $argoneonrtcscript CLEAN
/usr/bin/python3 $argoneonrtcscript SHUTDOWN
# Remove files
rm /lib/systemd/system/argoneond.service
fi
rm /usr/bin/argon-config
if [ -f "/usr/bin/argonone-config" ]
then
rm /usr/bin/argonone-config
rm /usr/bin/argonone-uninstall
rm /usr/bin/argonone-ir
fi
if [ -f "/usr/bin/argon-status" ]
then
rm /usr/bin/argon-status
fi
rm /lib/systemd/system-shutdown/argon-shutdown.sh
rm -R -f $INSTALLATIONFOLDER
echo "Removed Argon Services."
echo "Cleanup will complete after restarting the device."