modify: 加入了配置系统,不再用瞳孔地震的方式处理升级

This commit is contained in:
2023-08-13 21:44:53 +08:00
parent 9f32a02f35
commit 0e810cea87
4 changed files with 30 additions and 37 deletions

View File

@@ -28,6 +28,16 @@ if [ "$1" = "remove" -o "$1" = "purge" ] ; then
# 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
@@ -49,18 +59,4 @@ else
fi
fi
if [ "$1" = "upgrade" ] ; then
echo "非卸载操作,不进行配置清理"
if [ -f "/usr/lib/systemd/system/spark-update-notifier.service" ] ; then
mv -f /usr/lib/systemd/system/spark-update-notifier.service /usr/lib/systemd/system/spark-update-notifier.service.bak
fi
if [ ! -z "`pidof spark-store`" ] ; then
echo "关闭已有 spark-store..."
notify-send "正在升级星火商店" "请在升级结束后重启星火商店" -i spark-store
killall spark-store
else
echo "继续安装 spark-store..."
fi
fi