diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-11-06 08:43:22 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-11-06 08:43:22 +0000 |
commit | ad04b668d1c1aef6dd595e271add2eb34f07c638 (patch) | |
tree | 9855059bd1b19002abe2fa98669cc878a6aa1901 /lib/container/stop | |
parent | Adding upstream version 20161101-lts1. (diff) | |
download | open-infrastructure-compute-tools-ad04b668d1c1aef6dd595e271add2eb34f07c638.tar.xz open-infrastructure-compute-tools-ad04b668d1c1aef6dd595e271add2eb34f07c638.zip |
Adding upstream version 20161105.upstream/20161105
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/stop')
-rwxr-xr-x | lib/container/stop | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/container/stop b/lib/container/stop index ba8960d..ec24d51 100755 --- a/lib/container/stop +++ b/lib/container/stop @@ -27,8 +27,8 @@ CLEAN="false" Parameters () { - LONG_OPTIONS="name:,clean," - OPTIONS="n:," + LONG_OPTIONS="name:,force,clean," + OPTIONS="n:,f," PARAMETERS="$(getopt --longoptions ${LONG_OPTIONS} --name=${COMMAND} --options ${OPTIONS} --shell sh -- ${@})" @@ -48,6 +48,10 @@ Parameters () shift 2 ;; + -f|--force) + FORCE="true" + ;; + --clean) # internal option CLEAN="true" @@ -166,5 +170,15 @@ case "${STATE}" in ;; esac +case "${FORCE}" in + true) + MODE="terminate" + ;; + + *) + MODE="poweroff" + ;; +esac + # Run -machinectl poweroff ${NAME} +machinectl ${MODE} ${NAME} |