]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds config_unset action
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 11 Jun 2018 13:57:34 +0000 (10:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 11 Jun 2018 13:57:34 +0000 (10:57 -0300)
kvmx

diff --git a/kvmx b/kvmx
index d5504c0d78c83c4a2aeb825f37f7b93bada02bc8..0015b79d684aeb85bad9c7aa6e0953f382ee6a47 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -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 $*