From 649e6fe6f8229ccfea4d4a12c410efe823d21174 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 31 Oct 2023 22:40:02 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index d13f34d8..1ca7d058 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -1119,17 +1119,19 @@ SHUTDOWN_SERVER(){ echo "($datetime) - Shutting down ${host} (${hostip})" >> ${PW_LOGFILE} echo -en "${idsCL[LightCyan]}Enabling maintenance mode ... " - [ "${TEST}" != "true" ] && ${PW_FOLDER}/esxi-scripts/host-maintenance_mode.ps1 ${PW_ESXI_HOST_NAMES[${hostip}]} & >/dev/null 2>&1 + [ "${TEST}" != "true" ] && ${PW_FOLDER}/esxi-scripts/host-maintenance_mode.ps1 ${PW_ESXI_HOST_NAMES[${hostip}]} & >/dev/null 2>&1 || sleep 3s echo -e "${idsCL[Green]}Done\n" echo -en "${idsCL[LightCyan]}Giving time for iSCSI VM's to begin migration to other hosts ... " - [ "${TEST}" != "true" ] && sleep 45s || sleep 10s + [ "${TEST}" != "true" ] && sleep 45s || sleep 3s echo -e "${idsCL[Green]}Done\n" echo -en "${idsCL[LightCyan]}Shutting down remaining VM's on: ${host} (${hostip}) ... " if [ "${TEST}" != "true" ]; then ${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 ${hostip} >/dev/null 2>&1 ${PW_FOLDER}/esxi-scripts/iscsi-server-shutdown.ps1 ${hostip} >/dev/null 2>&1 + else + sleep 3s fi echo -e "${idsCL[Green]}Done\n" @@ -1137,6 +1139,8 @@ SHUTDOWN_SERVER(){ if [ "${TEST}" != "true" ]; then ssh root@${hostip} 'esxcli system shutdown poweroff -d 10 -r "Automated ESXi host shutdown"' & >/dev/null 2>&1 ssh root@${hostip} 'esxcli system maintenanceMode set -e false -t 0' >/dev/null 2>&1 + else + sleep 3s fi echo -e "${idsCL[Green]}Done\n" @@ -1145,6 +1149,8 @@ SHUTDOWN_SERVER(){ while ping -qw 10 -c3 "${hostip}">/dev/null 2>&1; do sleep 1 done + else + sleep 3s fi echo -e "${idsCL[Green]}Done\n"