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:
Alexis Ben Miloud--Josselin 2018-07-19 11:37:29 +02:00
parent 5106b550d3
commit 555b8eb7b6

View file

@ -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"