summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/remove15
1 files changed, 14 insertions, 1 deletions
diff --git a/libexec/container/remove b/libexec/container/remove
index 4cb5d48..fe9b18b 100755
--- a/libexec/container/remove
+++ b/libexec/container/remove
@@ -27,12 +27,13 @@ COMMAND="$(basename ${0})"
CONFIG="/etc/${SOFTWARE}/config"
HOOKS="/etc/${SOFTWARE}/hooks"
MACHINES="/var/lib/machines"
+VMS="/srv/container/vms"
Parameters ()
{
OPTIONS_ALL=""
- GETOPT_LONGOPTIONS="name:,allow-stop,force,verbose,"
+ GETOPT_LONGOPTIONS="name:,allow-stop,force,verbose,vm"
GETOPT_OPTIONS="n:,f,v,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -74,6 +75,11 @@ Parameters ()
OPTIONS_ALL="${OPTIONS_ALL} --verbose"
;;
+ --vm)
+ VM="true"
+ shift 1
+ ;;
+
--)
shift 1
break
@@ -243,6 +249,13 @@ case "${VERBOSE}" in
esac
rm --preserve-root --one-file-system -rf ${RM_OPTIONS} "${MACHINES}/${NAME}"
+
+case ${VM} in
+ true)
+ rm --preserve-root --one-file-system -rf ${RM_OPTIONS} "${VMS}/${NAME}"
+ ;;
+esac
+
rm -f ${RM_OPTIONS} "${CONFIG}/${NAME}.conf"
case "${VERBOSE}" in