etc/init.d/vz*: fix CT (re)start

Commit af5bf43 introduced support for restarting containers that were
running before reboot. Unfortunately, there is a bug in this code:

	# List CTs from vzrebootdir plus the ones with ONBOOT=yes
	velist=$(ls $VZREBOOTDIR;
		vzlist -aH -octid,onboot | awk '$2 == "yes" {print $1}')
	# Then sort by bootorder
	velist=$(vzlist -aH -octid -s-bootorder $velist)

If velist is empty after the first step, second step (sorting by
bootorder) lists ALL the containers.

The fix, as pointed out by Tom P, is to check if velist is empty.

http://bugzilla.openvz.org/2424

Reported-by: Tom P <tomp@tomp.co.uk>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed