Fix crash when vm is not running
Due to the `set -e`, the script exited when $VM was no in "running" state.
This commit is contained in:
parent
5106b550d3
commit
555b8eb7b6
|
@ -72,7 +72,7 @@ do
|
||||||
DISK=0
|
DISK=0
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
RUNNING=$(virsh domstate "$VM" | grep -q '^running$' && echo X)
|
RUNNING=$(virsh domstate "$VM" | grep -q '^running$' && echo yes || echo no)
|
||||||
echo "$VM $VCPU $RAM $DISK $RUNNING"
|
echo "$VM $VCPU $RAM $DISK $RUNNING"
|
||||||
done >"$TMPFILE"
|
done >"$TMPFILE"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue