deep-wine-runner/UnMount.sh

38 lines
766 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ ` whoami ` != "root" ]; then
echo "Only root can run me"
exit 1
fi
if [ ! -d "$1" ]; then
echo "路径不存在!"
exit 1
fi
echo $0
echo $1
echo $2
#echo $3
# 挂载必备目录
cd "$1"
umount ./dev
umount ./dev/pts
umount ./proc
umount ./etc/resolv.conf
umount ./sys
umount ./dev/shm
# 挂载 Wine 运行器目录
umount ./opt
umount ./opt/apps/deepin-wine-runner
# 挂载字体
umount ./usr/share/fonts
# 挂载用户目录到 /root默认 $HOME 路径)
umount ./root
for username in $(ls ./home)
do
echo ./home/$username
umount ./home/$username
# if [ -d ./home/$username/.deepinwine/$CONTAINER_NAME ]
# then
# rm -rf ./home/$username/.deepinwine/$CONTAINER_NAME
# fi
done