From b127c26b3dc7aa160e610b39a034fc3c93a4adec Mon Sep 17 00:00:00 2001 From: shenmo Date: Thu, 3 Nov 2022 19:40:52 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20sp?= =?UTF-8?q?ark-dwine-helper/postrm=20=09=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=9A=20=20=20spark-dwine-launch/postrm=5Ftemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spark-dwine-helper/postrm | 1 + spark-dwine-launch/postrm_template | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 spark-dwine-launch/postrm_template diff --git a/spark-dwine-helper/postrm b/spark-dwine-helper/postrm index 43b74d9..43bf4da 100644 --- a/spark-dwine-helper/postrm +++ b/spark-dwine-helper/postrm @@ -1,3 +1,4 @@ +#!/bin/bash if [ "$1" = "remove" ] || [ "$1" = "purge" ];then echo "清理卸载残留" diff --git a/spark-dwine-launch/postrm_template b/spark-dwine-launch/postrm_template new file mode 100644 index 0000000..374856e --- /dev/null +++ b/spark-dwine-launch/postrm_template @@ -0,0 +1,25 @@ +#!/bin/bash +if [ "$1" = "remove" ] || [ "$1" = "purge" ];then + +echo "清理卸载残留" +CONTAINER_NAME="" + +if [ -z $CONTAINER_NAME ];then +echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除" +exit +fi + +/opt/deepinwine/tools/kill.sh $CONTAINER_NAME +###这里注意,如果没写CONTAINER_NAME,会把QQ杀了 + +for username in $(ls /home) + do + echo /home/$username + if [ -d /home/$username/.deepinwine/$CONTAINER_NAME ] + then + rm -rf /home/$username/.deepinwine/$CONTAINER_NAME + fi + done +else +echo "非卸载,跳过清理" +fi