summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-27 18:57:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-27 18:57:08 +0000
commit34f9dde6d7bc82cef01eb7b3ab001f3e058782f2 (patch)
treebebd390e420aa1556459c192836e271417411273 /lib/container/remove
parentAdding upstream version 20180503. (diff)
downloadopen-infrastructure-compute-tools-34f9dde6d7bc82cef01eb7b3ab001f3e058782f2.tar.xz
open-infrastructure-compute-tools-34f9dde6d7bc82cef01eb7b3ab001f3e058782f2.zip
Adding upstream version 20180527.upstream/20180527
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container/remove')
-rwxr-xr-xlib/container/remove23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/container/remove b/lib/container/remove
index e8dd653..275c867 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -28,6 +28,8 @@ MACHINES="/var/lib/machines"
Parameters ()
{
+ OPTIONS_ALL=""
+
GETOPT_LONGOPTIONS="name:,allow-stop,force,verbose,"
GETOPT_OPTIONS="n:,f,v,"
@@ -52,16 +54,22 @@ Parameters ()
--allow-stop)
ALLOW_STOP="true"
shift 1
+
+ OPTIONS_ALL="${OPTIONS_ALL} --allow-stop"
;;
-f|--force)
FORCE="true"
shift 1
+
+ OPTIONS_ALL="${OPTIONS_ALL} --force"
;;
- -f|--verbose)
+ -v|--verbose)
VERBOSE="true"
shift 1
+
+ OPTIONS_ALL="${OPTIONS_ALL} --verbose"
;;
--)
@@ -111,6 +119,19 @@ then
Usage
fi
+case "${NAME}" in
+ ALL)
+ NAMES="$(container list --format shell --stopped)"
+
+ for NAME in ${NAMES}
+ do
+ container remove --name ${NAME} ${OPTIONS_ALL} || true
+ done
+
+ exit 0
+ ;;
+esac
+
if [ ! -e "${MACHINES}/${NAME}" ] && [ ! -e "${CONFIG}/${NAME}.conf" ]
then
echo "'${NAME}': no such container" >&2