2022-09-11 20:44:16 +08:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
|
|
|
|
|
|
|
|
|
echo "清理卸载残留"
|
2022-11-06 12:49:34 +08:00
|
|
|
|
CONTAINER_NAME="@deb_package_name@"
|
|
|
|
|
|
|
|
|
|
if [ -z $CONTAINER_NAME ];then
|
|
|
|
|
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -e /opt/deepinwine/tools/kill.sh ];then
|
|
|
|
|
/opt/deepinwine/tools/kill.sh $CONTAINER_NAME
|
|
|
|
|
###这里注意,如果没写CONTAINER_NAME,会把QQ杀了
|
|
|
|
|
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
|
|
|
|
|
if [ -d /home/$username/.deepinwine/$CONTAINER_NAME ]
|
|
|
|
|
then
|
|
|
|
|
rm -rf /home/$username/.deepinwine/$CONTAINER_NAME
|
|
|
|
|
fi
|
2022-09-11 20:44:16 +08:00
|
|
|
|
done
|
|
|
|
|
else
|
2022-11-06 12:49:34 +08:00
|
|
|
|
echo "非卸载,跳过清理"
|
2022-09-11 20:44:16 +08:00
|
|
|
|
fi
|