spark-store/debian/spark-store.prerm
2023-03-09 10:31:54 +08:00

52 lines
1.4 KiB
Bash
Executable File

#!/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" ] || [ "$1" = "purge" ] ; then
# Remove residual symbol links
rm -f /usr/local/bin/spark-store
rm -f /usr/local/bin/ssinstall
rm -f /usr/local/bin/ssaudit
rm -f /usr/local/bin/spark-dstore-patch
rm -f /usr/local/bin/ss-apt-fast
rm -f /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
# Shutdown services
systemctl stop spark-update-notifier
# Stop update detect service
systemctl disable spark-update-notifier
# Clean the auto install polkit file if exist
rm -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
# 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'
else
echo "非卸载操作,不进行配置清理"
if [ ! -z "`pidof spark-store`" ];then
echo "关闭已有 spark-store.."
notify-send "正在升级星火商店" "请在升级结束后重启星火商店" -i spark-store
killall spark-store
else
echo "继续安装 spark-store.."
fi
fi