File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,14 @@ GRACE_PERIOD=3600
55
66for VMID in ` vim-cmd vmsvc/getallvms | awk ' { if (NR > 1) print $1 }' `
77do
8- vim-cmd vmsvc/power.getstate $VMID
9-
108 ON=` vim-cmd vmsvc/power.getstate $VMID | grep " Powered on" || EXIT=$? `
119 if [[ -n " $ON " ]]; then
1210 HB=` vim-cmd vmsvc/get.guestheartbeatStatus $VMID `
1311 if [ " $HB " != " green" ]; then
14- UPTIME=` vim-cmd vmsvc/get.summary 259 | sed -rn ' s/\ +uptimeSeconds\ =\ ([0-9]+),\ +/\1/p' `
12+ UPTIME=` vim-cmd vmsvc/get.summary $VMID | sed -rn ' s/\ +uptimeSeconds\ =\ ([0-9]+),\ +/\1/p' `
1513 if [ " $UPTIME " -gt " $GRACE_PERIOD " ]; then
1614 echo " Powering off VM: $VMID "
17- vim-cmd vmsvc/power.off $VMID
15+ vim-cmd vmsvc/power.off $VMID > /dev/null
1816 fi
1917 fi
2018 fi
You can’t perform that action at this time.
0 commit comments