-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathspark-store.prerm
executable file
·64 lines (49 loc) · 1.57 KB
/
spark-store.prerm
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
#!/bin/bash
function notify-send()
{
# Detect the user using such display
local user=$(who | awk '{print $1}' | head -n 1)
# Detect the id of the user
local uid=$(id -u $user)
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@"
}
if [ "$1" = "remove" -o "$1" = "purge" ] ; then
echo "$1"
echo "卸载操作,进行配置清理"
# Remove residual symbol links
unlink /usr/local/bin/spark-store
unlink /usr/local/bin/ssinstall
unlink /usr/local/bin/ssaudit
unlink /usr/bin/ssinstall
unlink /usr/bin/ssaudit
unlink /usr/local/bin/spark-dstore-patch
unlink /usr/bin/spark-dstore-patch
unlink /usr/local/bin/ss-apt-fast
unlink /usr/bin/aptss
rm -rf /etc/aptss/
rm -rf /var/lib/aptss/
# Remove residual symbol links to stop upgrade detect
rm -f /etc/xdg/autostart/spark-update-notifier.desktop
# Remove config files
for username in `ls /home`
do
echo /home/$username
if [ -d /home/$username/.config/spark-union/spark-store ]
then
rm -rf /home/$username/.config/spark-union/spark-store
fi
done
# Shutdown services
systemctl stop spark-update-notifier
# Stop update detect service
systemctl disable spark-update-notifier
# Remove gpg key file
rm -f /etc/apt/trusted.gpg.d/spark-store.gpg
apt-key del '9D9A A859 F750 24B1 A1EC E16E 0E41 D354 A29A 440C' || true
else
if [ ! -z "`pidof spark-store`" ] ; then
echo "关闭已有 spark-store.."
notify-send "正在升级星火商店" "请在升级结束后重启星火商店" -i spark-store
killall spark-store
fi
fi