Update powerwall.sh

This commit is contained in:
2023-10-31 22:45:39 -05:00
parent 3a08b2773a
commit 250809f67a

View File

@@ -1123,34 +1123,29 @@ SHUTDOWN_SERVER(){
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 3s
[ "${TEST}" != "true" ] && sleep 45s
echo -e "${idsCL[Green]}Done\n"
echo -en "${idsCL[LightCyan]}Shutting down remaining VM's on: ${host} (${hostip}) ... "
echo -en "${idsCL[LightCyan]}Shutting down remaining VM's ... "
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"
echo -en "${idsCL[LightCyan]}Shutting down Host: ${host} (${hostip}) ... "
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 -en "${idsCL[LightCyan]}Shutting down Host ... "
[ "${TEST}" != "true" ] && ssh root@${hostip} 'esxcli system shutdown poweroff -d 10 -r "Automated ESXi host shutdown"' & >/dev/null 2>&1
echo -e "${idsCL[Green]}Host will begin shutdown in 10secs\n"
echo -en "${idsCL[LightCyan]}Disabling maintenance mode ... "
[ "${TEST}" != "true" ] && ssh root@${hostip} 'esxcli system maintenanceMode set -e false -t 0' >/dev/null 2>&1
echo -e "${idsCL[Green]}Done\n"
echo -en "${idsCL[LightCyan]}Waiting for Host ${host} (${hostip}) to shutdown ... "
if [ "${TEST}" != "true" ]; then
while ping -qw 10 -c3 "${hostip}">/dev/null 2>&1; do
sleep 1
done
else
sleep 3s
fi
echo -e "${idsCL[Green]}Done\n"