VMWare 4,5,6 virtuelle maschine starten wenn powered off
#!/bin/sh
STR="Powered off"
/bin/vim-cmd vmsvc/getallvms |grep vmx-08 | awk '{print $1}' > /vmfs/volumes/vm1-raid6/skripte/erg
while read line
do
{
X1=$(/bin/vim-cmd vmsvc/power.getstate $line | grep "$STR")
if [ "$X1" = "$STR" ] ; then $(/bin/vim-cmd vmsvc/power.on $line)
else echo $line "ist on"
fi
}
done < /vmfs/volumes/vm1-raid6/skripte/erg