diff options
author | Simon Spöhel <simon@spoehel.ch> | 2023-08-24 14:36:59 +0000 |
---|---|---|
committer | Simon Spöhel <simon@spoehel.ch> | 2023-08-24 14:41:27 +0000 |
commit | 0fca311aecbe2d112bb844a4c861bc8be0f653ca (patch) | |
tree | 0308e2c75f00ead4ca1e670a8025ee9765c74c5a | |
parent | poor cnt ls for vms. (diff) | |
download | compute-tools-0fca311aecbe2d112bb844a4c861bc8be0f653ca.tar.xz compute-tools-0fca311aecbe2d112bb844a4c861bc8be0f653ca.zip |
basic cnt rm support.
-rwxr-xr-x | libexec/container/remove | 15 |
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 |