summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Cohen <bencoh@notk.org>2012-11-20 15:46:57 +0100
committerroot <root@notk.org>2012-11-20 15:46:57 +0100
commitfba0e40a1bd5f2b1710ecac156c0b28dc7611d97 (patch)
treeda904ef3ee773efccfb66158a40d1e26d0c892dd
parentfbe518e435003babe5e75f2e6790f1b29d943a28 (diff)
Check EDITOR envvar where needed
-rwxr-xr-xkvm-wrapper.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index f1cf1b2..84f4145 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -672,6 +672,7 @@ function kvm_list ()
function kvm_edit_descriptor ()
{
+ [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor."
kvm_init_env "$1"
test_file "$VM_DESCRIPTOR" && "$EDITOR" "$VM_DESCRIPTOR"
}
@@ -875,6 +876,7 @@ function kvm_build_vm ()
"-e"|"--edit"|"--edit-conf")
local EDIT_CONF="yes"
shift
+ [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor."
;;
"--no-bootstrap")
local DISABLE_BOOTSTRAP="yes"
@@ -956,6 +958,7 @@ function kvm_remove_vm ()
function kvm_edit_conf ()
{
+ [[ -z "$EDITOR" ]] && fail_exit "Please set the EDITOR envvar to your favourite editor."
eval "$EDITOR" "$CONFFILE"
}