fixing more bash issues
This commit is contained in:
parent
64db728731
commit
5d3dbac9ba
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
|
|
||||||
vmname="$1"
|
vmname="$1"
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ fi
|
|||||||
|
|
||||||
# this will let us know if the vm exists or not
|
# this will let us know if the vm exists or not
|
||||||
exists="false"
|
exists="false"
|
||||||
state = "unknown"
|
state="unknown"
|
||||||
if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
|
if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
|
||||||
exists="true"
|
exists="true"
|
||||||
|
|
||||||
@ -21,11 +21,11 @@ if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "$state_code" in
|
case "$state_code" in
|
||||||
1) state = "running" ;;
|
1) state="running" ;;
|
||||||
2) state = "blocked" ;;
|
2) state="blocked" ;;
|
||||||
4) state = "stopping" ;;
|
4) state="stopping" ;;
|
||||||
6) state = "crashed" ;;
|
6) state="crashed" ;;
|
||||||
[357]) state = "stopped" ;;
|
[357]) state="stopped" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user