diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-06-11 10:57:34 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-06-11 10:57:34 -0300 |
commit | 8d1967a3f3af633ec41f36938f4e2549e91f12d7 (patch) | |
tree | bdaaa4717412b00f1a26218a223406666df0261c | |
parent | 684ca29524749320e0dfa0aa331bf105e2e5379f (diff) | |
download | kvmx-8d1967a3f3af633ec41f36938f4e2549e91f12d7.tar.gz kvmx-8d1967a3f3af633ec41f36938f4e2549e91f12d7.tar.bz2 |
Adds config_unset action
-rwxr-xr-x | kvmx | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -195,7 +195,8 @@ function __kvmx_initialize { mkdir -p $STATE_DIR $LOG_DIR if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "provision" ] && [ "$ACTION" != "purge" ] \ - && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ] && [ "$ACTION" != "config" ]; then + && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ] && [ "$ACTION" != "config" ] \ + && [ "$ACTION" != "config_unset" ]; then echo "$BASENAME: file not found: $image" exit 1 fi @@ -1118,6 +1119,16 @@ function kvmx_config { fi } +# Unset a guest config by commenting it +function kvmx_config_unset { + if [ ! -z "$1" ]; then + sed -i -e "s/^$1=/#$1=/" $KVMXFILE + else + echo $BASENAME: missing config parameter + exit 1 + fi +} + # Alias to config function kvmx_edit { kvmx_config $* |