diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-06-10 14:55:50 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-06-10 14:55:50 -0300 |
commit | 684ca29524749320e0dfa0aa331bf105e2e5379f (patch) | |
tree | 5827ee48dbd1a13cf6abd18636882ba53b2ed92f | |
parent | 7ed7c785f4731b7b0d7d1b2474d658ae4fe731ea (diff) | |
download | kvmx-684ca29524749320e0dfa0aa331bf105e2e5379f.tar.gz kvmx-684ca29524749320e0dfa0aa331bf105e2e5379f.tar.bz2 |
Config: sed needs to work on KVMXFILE, not in the symlink, otherwise the symlink is broken
-rwxr-xr-x | kvmx | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -119,7 +119,7 @@ function __kvmx_initialize { fi # Load and check guest config - if [ "$ACTION" != "ls" ] && [ "$ACTION" != "edit" ] && [ "$ACTION" != "usage" ] && [ "$ACTION" != "config" ]; then + if [ "$ACTION" != "ls" ] && [ "$ACTION" != "edit" ] && [ "$ACTION" != "usage" ]; then if [ ! -e "$GLOBAL_USER_CONFIG_FOLDER/$VM" ]; then if [ -e "kvmxfile" ]; then # Existing kvmxfile but not registered at the global user config @@ -195,7 +195,7 @@ function __kvmx_initialize { mkdir -p $STATE_DIR $LOG_DIR if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "provision" ] && [ "$ACTION" != "purge" ] \ - && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ]; then + && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ] && [ "$ACTION" != "config" ]; then echo "$BASENAME: file not found: $image" exit 1 fi @@ -1108,12 +1108,12 @@ function kvmx_config { shift if [ -z "$1" ]; then - grep "^$param=" $GLOBAL_USER_CONFIG_FOLDER/$VM | \ + grep "^$param=" $KVMXFILE | \ sed -e 's/="/=/' -e 's/"$//' -e "s/='/=/" -e "s/'$//" -e 's/^.*=//' - elif ! grep -q "^$param=" $GLOBAL_USER_CONFIG_FOLDER/$VM; then - echo "$param=\"$*\"" >> $GLOBAL_USER_CONFIG_FOLDER/$VM + elif ! grep -q "^$param=" $KVMXFILE; then + echo "$param=\"$*\"" >> $KVMXFILE else - sed -i -e "s#^$param=.*#$param=\"$*\"#" $GLOBAL_USER_CONFIG_FOLDER/$VM + sed -i -e "s#^$param=.*#$param=\"$*\"#" $KVMXFILE fi fi } |