From c7301305e6965736c5c613dff8f5b555c9763257 Mon Sep 17 00:00:00 2001 From: pr1ntf Date: Fri, 23 Jun 2017 01:06:01 +0000 Subject: [PATCH] check if guest exists before set --- lib/ioh-zfs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ioh-zfs b/lib/ioh-zfs index 881bedf..294b8a3 100644 --- a/lib/ioh-zfs +++ b/lib/ioh-zfs @@ -8,6 +8,10 @@ __zfs_set() { printf "\tset ...\n" exit 1 fi + if ! __guest_exist $name; then + echo "Guest $name doesn't exist!" + return 1 + fi local pool="$(zfs list -H -t volume | cut -d '/' -f-3 | grep iohyve/$name | cut -d '/' -f 1 | head -n1)" shift 2 for arg in "$@"; do