diff --git a/capsulflask/shell_scripts/get.sh b/capsulflask/shell_scripts/get.sh index 74ec705..ff7af37 100755 --- a/capsulflask/shell_scripts/get.sh +++ b/capsulflask/shell_scripts/get.sh @@ -10,12 +10,12 @@ fi # this will let us know if the vm exists or not exists="false" state = "unknown" -if ! virsh domuuid "$vmname" | grep -qE '^[\t\s\n]*$'; then +if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then exists="true" state_code="$(virsh domstats $vmname | grep state.state | cut -d '=' -f 2)" - if ! printf "$state_code" | grep -qE '^[0-8]$'; then + if printf "$state_code\n" | grep -vqE '^[0-8]$'; then printf 'state_code was not detected. state_code %s must match ^[0-8]$\n' "$state_code" exit 1 fi