#!/bin/sh
I=1
while vzctl --quiet status $VEID | grep -Fw running; do
	sleep $I
	I=$((I+1))
	test $I -gt 10 && exit 1
done

if vzctl --quiet status $VEID | grep -Fw mounted; then
	vzctl --quiet unmount $VEID
fi

vzctl --quiet start $VEID
