summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-08-04 13:45:49 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-08-04 13:50:13 +0000
commite1ac8c36854fbeb60a53a5090fbb673b2a7b9d09 (patch)
treecc969c8a612fe7412f9d14759e6dc64c77b2a5a1 /lib/container/remove
parentReleasing debian version 20160701-1. (diff)
downloadopen-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.tar.xz
open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.zip
Merging upstream version 20160801.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/remove')
-rwxr-xr-xlib/container/remove25
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/container/remove b/lib/container/remove
index e4bb20c..843e9c3 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -25,8 +25,8 @@ MACHINES="/var/lib/machines"
Parameters ()
{
- LONG_OPTIONS="name:,force,"
- OPTIONS="n:,f,"
+ LONG_OPTIONS="name:,force,verbose,"
+ OPTIONS="n:,f,v,"
PARAMETERS="$(getopt --longoptions ${LONG_OPTIONS} --name=${COMMAND} --options ${OPTIONS} --shell sh -- ${@})"
@@ -51,6 +51,11 @@ Parameters ()
shift 1
;;
+ -f|--verbose)
+ VERBOSE="true"
+ shift 1
+ ;;
+
--)
shift 1
break
@@ -66,7 +71,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -n|--name NAME [-f|--force]" >&2
+ echo "Usage: container ${COMMAND} -n|--name NAME [-f|--force] [-v|--verbose]" >&2
exit 1
}
@@ -113,6 +118,16 @@ case "${FORCE}" in
;;
esac
+case "${VERBOSE}" in
+ true)
+ RM_OPTIONS="--verbose"
+ ;;
+
+ *)
+ RM_OPTIONS=""
+ ;;
+esac
+
# data
if [ -e "${CONFIG}/${NAME}.conf" ]
then
@@ -133,5 +148,5 @@ then
fi
# Run
-rm --preserve-root --one-file-system -rf "${MACHINES}/${NAME}"
-rm -f "${CONFIG}/${NAME}.conf"
+rm --preserve-root --one-file-system -rf ${RM_OPTIONS} "${MACHINES}/${NAME}"
+rm -f ${RM_OPTIONS} "${CONFIG}/${NAME}.conf"