Update powerwall.sh
This commit is contained in:
58
powerwall.sh
58
powerwall.sh
@@ -1263,7 +1263,7 @@ SHUTDOWN_SERVERS(){
|
|||||||
if [ ! -f ${PW_FOLDER}/shutdown.main ]; then
|
if [ ! -f ${PW_FOLDER}/shutdown.main ]; then
|
||||||
touch ${PW_FOLDER}/shutdown.main
|
touch ${PW_FOLDER}/shutdown.main
|
||||||
|
|
||||||
if [ "${2}" == "TEMP" ]; then
|
if [ "${2}" == "TEMP" ] && [ "${2}" != "maintenance" ]; then
|
||||||
MSG="Disabling CLS in vCenter"
|
MSG="Disabling CLS in vCenter"
|
||||||
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
||||||
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
||||||
@@ -1326,42 +1326,44 @@ SHUTDOWN_SERVERS(){
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
for ESXIHOST in "${PW_MAINHOSTS[@]}"; do
|
if [ "${2}" == "maintenance" ]; then
|
||||||
MSG="Wait for VM's to power off, then shutdown '${PW_ESXI_HOST_NAMES[${ESXIHOST}]}'"
|
for ESXIHOST in "${PW_MAINHOSTS[@]}"; do
|
||||||
|
MSG="Wait for VM's to power off, then shutdown '${PW_ESXI_HOST_NAMES[${ESXIHOST}]}'"
|
||||||
|
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
||||||
|
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
||||||
|
if [ "${TEST}" != "true" ]; then
|
||||||
|
MAINT_MODE_VERIFY_SHUTDOWN ${ESXIHOST} &
|
||||||
|
echo -e "${idsCL[Green]}Continuing in background\n"
|
||||||
|
else
|
||||||
|
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
MSG="Waiting for iSCSI-PRI Host to shutdown"
|
||||||
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
||||||
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
||||||
if [ "${TEST}" != "true" ]; then
|
if [ "${TEST}" != "true" ]; then
|
||||||
MAINT_MODE_VERIFY_SHUTDOWN ${ESXIHOST} &
|
while ping -qw 10 -c3 "10.10.2.10">/dev/null 2>&1; do sleep 1; done
|
||||||
echo -e "${idsCL[Green]}Continuing in background\n"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}\n"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
done
|
MSG="Powering OFF the SAS Enclosure"
|
||||||
echo
|
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
||||||
MSG="Waiting for iSCSI-PRI Host to shutdown"
|
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
||||||
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
if [ "${TEST}" != "true" ]; then
|
||||||
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
if [ "$(CHECK_HOST 10.10.2.10)" == "false" ]; then
|
||||||
if [ "${TEST}" != "true" ]; then
|
run=$(snmpset -v 1 -c private ${PW_APCPDU_IP} .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.14 i 2 >/dev/null 2>&1)
|
||||||
while ping -qw 10 -c3 "10.10.2.10">/dev/null 2>&1; do sleep 1; done
|
sleep 3s
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}\n"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}\n"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}'${PW_iDRACHOST_SHORTNAMES[${idracip}]}' is not offline, not powering down\n"
|
||||||
fi
|
fi
|
||||||
MSG="Powering OFF the SAS Enclosure"
|
|
||||||
c=0; MSG_SPC=''; spc1=`expr ${hc_cw} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
|
||||||
echo -en "${idsCL[LightCyan]}${MSG}${MSG_SPC}: "
|
|
||||||
if [ "${TEST}" != "true" ]; then
|
|
||||||
if [ "$(CHECK_HOST 10.10.2.10)" == "false" ]; then
|
|
||||||
run=$(snmpset -v 1 -c private ${PW_APCPDU_IP} .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.14 i 2 >/dev/null 2>&1)
|
|
||||||
sleep 3s
|
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}\n"
|
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[LightRed]}'${PW_iDRACHOST_SHORTNAMES[${idracip}]}' is not offline, not powering down\n"
|
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
else
|
echo
|
||||||
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
|
||||||
fi
|
fi
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "${1^^}" == "SYS" ]; then
|
elif [ "${1^^}" == "SYS" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user