forked from cosimoscarcella/wordpress-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-uninstall.sh
executable file
·40 lines (36 loc) · 897 Bytes
/
wp-uninstall.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/sh
REMOVE_IMAGES=""
REMOVE_VOLUMES=""
function usage()
{
echo ""
echo "Usage: sh $0 [OPTIONS]"
echo ""
echo "Options:"
echo " -h | --help Show this help message and exit"
echo " -i | --images Remove docker images related to installation"
echo " -v | --volumes Remove all docker volumes related to installation"
echo ""
}
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
case $PARAM in
-h | --help)
usage
exit
;;
-i | --images)
REMOVE_IMAGES="--rmi all"
;;
-v | --volumes)
REMOVE_VOLUMES="--volumes"
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
usage
exit 1
;;
esac
shift
done
docker-compose down $REMOVE_VOLUMES $REMOVE_IMAGES