update spark-dwine-launch/postrm_template.

Signed-off-by: RX6900XT <qq482961502@gmail.com>
This commit is contained in:
RX6900XT
2022-12-27 05:46:56 +00:00
committed by Gitee
parent 806da4f51b
commit 6e21ae24a4

View File

@@ -2,8 +2,8 @@
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留" echo "清理卸载残留"
CONTAINER_NAME="" BOTTLE_NAME="" #容器名
PACK_NAME="" PACK_NAME="" #软体套件名
MIME_TYPE="" MIME_TYPE=""
ACTIVEX_NAME="" ACTIVEX_NAME=""
MAKE_AUTOSTART="" MAKE_AUTOSTART=""
@@ -13,9 +13,9 @@ make_autostart()
{ {
for file in $(ls /home) for file in $(ls /home)
do do
if [ -d "/home/$file/.config/autostart" ] if [ -d "/home/${USER}/.config/autostart" ]
then then
rm /home/$file/.config/autostart/${PACK_NAME}.desktop rm /home/${USER}/.config/autostart/${PACK_NAME}.desktop
fi fi
done done
} }
@@ -24,11 +24,11 @@ send_to_desktop()
{ {
for file in $(ls /home) for file in $(ls /home)
do do
if [ -d "/home/$file/.config/autostart" ] if [ -d "/home/${USER}/.config/autostart" ]
then then
desktop=$(cat /etc/xdg/user-dirs.defaults | grep DESKTOP | awk -F= '{print $2}') desktop=$(cat /etc/xdg/user-dirs.defaults | grep DESKTOP | awk -F= '{print $2}')
if [ -d "/home/$file/$desktop" ]; then if [ -d "/home/${USER}/$desktop" ]; then
rm /home/$file/$desktop/${PACK_NAME}*.desktop rm /home/${USER}/$desktop/${PACK_NAME}*.desktop
fi fi
fi fi
done done
@@ -47,22 +47,22 @@ if [ -n "$ACTIVEX_NAME" ]; then
fi fi
if [ -z $CONTAINER_NAME ];then if [ -z $BOTTLE_NAME ];then
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除" echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
exit exit
fi fi
if [ -e /opt/deepinwine/tools/kill.sh ];then if [ -e /opt/deepinwine/tools/kill.sh ];then
/opt/deepinwine/tools/kill.sh $CONTAINER_NAME /opt/deepinwine/tools/kill.sh $BOTTLE_NAME
###这里注意,如果没写CONTAINER_NAME,会把QQ杀了 ###这里注意,如果没写BOTTLE_NAME,会把QQ杀了
fi fi
for username in $(ls /home) for username in $(ls /home)
do do
echo /home/$username echo /home/$username
if [ -d /home/$username/.deepinwine/$CONTAINER_NAME ] if [ -d /home/$username/.deepinwine/$BOTTLE_NAME ]
then then
rm -rf /home/$username/.deepinwine/$CONTAINER_NAME rm -rf /home/$username/.deepinwine/$BOTTLE_NAME
fi fi
done done
else else