2022-09-11 20:44:16 +08:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
|
|
|
|
|
|
|
|
|
echo "清理卸载残留"
|
2023-08-05 08:57:55 +08:00
|
|
|
|
BOTTLE_NAME="@public_bottle_name@" #在引号中填写容器名
|
|
|
|
|
PACK_NAME="@deb_package_name@" #在引号中填写软件包名
|
|
|
|
|
ACTIVEX_NAME="" #activex相关,若未使用,可不设置
|
|
|
|
|
MAKE_AUTOSTART="" #如果先前设置了开机自启,则在此处填写1
|
2022-11-06 12:49:34 +08:00
|
|
|
|
|
2023-08-05 08:57:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 以下为功能段,若只用于打包则以下内容可不看,只填写上方即可
|
|
|
|
|
|
|
|
|
|
make_autostart()
|
|
|
|
|
{
|
|
|
|
|
for username in $(ls /home)
|
|
|
|
|
do
|
|
|
|
|
echo /home/$username
|
|
|
|
|
if [ -d "/home/$username/.config/autostart" ]
|
|
|
|
|
then
|
|
|
|
|
rm /home/$username/.config/autostart/$PACK_NAME.desktop
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$MAKE_AUTOSTART" ]; then
|
|
|
|
|
make_autostart
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$ACTIVEX_NAME" ]; then
|
|
|
|
|
rm /usr/lib/mozilla/plugins/libpipelight-$ACTIVEX_NAME.so
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z $BOTTLE_NAME ];then
|
2022-11-06 12:49:34 +08:00
|
|
|
|
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2023-08-05 08:57:55 +08:00
|
|
|
|
if [ -e /opt/deepinwine/tools/spark_kill.sh ];then
|
|
|
|
|
/opt/deepinwine/tools/spark_kill.sh $BOTTLE_NAME
|
|
|
|
|
###这里注意,如果没写BOTTLE_NAME,会把QQ杀了
|
2022-11-06 12:49:34 +08:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
for username in $(ls /home)
|
2022-09-11 20:44:16 +08:00
|
|
|
|
do
|
2022-11-06 12:49:34 +08:00
|
|
|
|
echo /home/$username
|
2023-08-05 08:57:55 +08:00
|
|
|
|
if [ -d /home/$username/.deepinwine/$BOTTLE_NAME ]
|
2022-11-06 12:49:34 +08:00
|
|
|
|
then
|
2023-08-05 08:57:55 +08:00
|
|
|
|
rm -rf /home/$username/.deepinwine/$BOTTLE_NAME
|
2022-11-06 12:49:34 +08:00
|
|
|
|
fi
|
2022-09-11 20:44:16 +08:00
|
|
|
|
done
|
|
|
|
|
else
|
2022-11-06 12:49:34 +08:00
|
|
|
|
echo "非卸载,跳过清理"
|
2023-08-05 08:57:55 +08:00
|
|
|
|
fi
|