forked from RokasUrbelis/docker-wine-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclear.sh
More file actions
26 lines (25 loc) · 740 Bytes
/
clear.sh
File metadata and controls
26 lines (25 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Empty the docker container.
# We recommend to clean it at least once a month, this tool can be combined with
# crontab, which means you don't need to do it manually.
# This script also will empty APP_PATH subfile, you can backup it before cleaning if you want.
function CLEAR_CONTAINER() {
for i in $(awk '/docker-wine-linux/{print $1}'< <(sudo docker ps -a))
do
sudo docker stop $i && sudo docker rm $i
done
}
while true;do
read -p 'Are you sure clear the docker container for docker-wine-linux?[Y/N]'
case ${REPLY} in
'Y'|'y')
CLEAR_CONTAINER && echo 'clear done' && exit 0
;;
'N'|'n')
exit 0
;;
*)
echo -e 'Sorry,input error,please input again\n' && continue
;;
esac
done