fixing more bash issues

This commit is contained in:
forest 2021-02-17 21:22:01 -06:00
parent 64db728731
commit 5d3dbac9ba

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
vmname="$1"
@ -9,7 +9,7 @@ fi
# this will let us know if the vm exists or not
exists="false"
state = "unknown"
state="unknown"
if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
exists="true"
@ -21,11 +21,11 @@ if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
fi
case "$state_code" in
1) state = "running" ;;
2) state = "blocked" ;;
4) state = "stopping" ;;
6) state = "crashed" ;;
[357]) state = "stopped" ;;
1) state="running" ;;
2) state="blocked" ;;
4) state="stopping" ;;
6) state="crashed" ;;
[357]) state="stopped" ;;
esac
fi