Update powerwall.sh

This commit is contained in:
2023-12-12 17:22:04 -06:00
parent 6b5ee4ae0b
commit ad87df487b

View File

@@ -8,7 +8,7 @@ source /opt/idssys/defaults/default.inc
source /opt/idssys/powerwall/defaults.inc
source ${PW_FOLDER}/settings.conf
# TEST=true
TEST=true
shopt -s lastpipe
@@ -1300,7 +1300,7 @@ SHUTDOWN_SERVERS(){
if [ ! -f ${PW_TMPFOLDER}/power.main.off ]; then
touch ${PW_TMPFOLDER}/power.main.off
if [ "${2}" == "TEMP" ] && [ "${2}" != "maintenance" ]; then
if [ "${2}" != "maintenance" ]; then
MSG="Disabling CLS in vCenter"
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}: "
@@ -1409,7 +1409,7 @@ SHUTDOWN_SERVERS(){
if [ ! -f ${PW_TMPFOLDER}/power.sys.off ]; then
touch ${PW_TMPFOLDER}/power.sys.off
if [ "${2}" == "TEMP" ] && [ "${2}" != "maintenance" ]; then
if [ "${2}" != "maintenance" ]; then
MSG="Disabling CLS in vCenter"
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}: "
@@ -1494,7 +1494,6 @@ SHUTDOWN_SERVERS(){
touch ${PW_TMPFOLDER}/power.all.off
if [ "${2}" != "maintenance" ]; then
MSG="Disabling CLS in vCenter"
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}: "
@@ -1603,7 +1602,7 @@ SHUTDOWN_SERVERS(){
if [ ! -f ${PW_TMPFOLDER}/power.main.offsite ]; then
touch ${PW_TMPFOLDER}/power.main.offsite
if [ "${2}" == "TEMP" ] && [ "${2}" != "maintenance" ]; then
if [ "${2}" != "maintenance" ]; then
MSG="Disabling CLS in vCenter"
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}: "
@@ -1795,20 +1794,11 @@ SHUTDOWN_SERVER(){
ESXIHOST=${PW_HOST_ADDRESSES[${tmp}]}
else
ESXIHOST=''
fi
# echo -e "\n${idsCL[Yellow]}ESXi Host Powerdown"
# DIVIDER . yellow 75
fi
if [ "${ESXIHOST}" != "" ]; then
host=${PW_ESXI_HOST_NAMES[${ESXIHOST}]}
# c=0; spcA=''; spc1=`expr 21 - ${#host} - 1`; until [ ${c} = ${spc1} ]; do spcA="${spcA} "; c=`expr ${c} + 1`; done
# c=0; spcB=''; spc1=`expr 18 - ${#ESXIHOST} - 1`; until [ ${c} = ${spc1} ]; do spcB="${spcB} "; c=`expr ${c} + 1`; done
# echo -en "${idsCL[LightCyan]} Host: ${idsCL[Green]}${host}${spcA}"
# echo -en "${idsCL[LightCyan]}Host IP: ${idsCL[Green]}${ESXIHOST}${spcB}"
# echo -e "${idsCL[LightCyan]}iDrac IP: ${idsCL[Green]}${PW_HOST_IDRACS[${host}]}${idsCL[Default]}"
# DIVIDER . yellow 75
# echo
if [ "${2}" == "maintenance" ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - Putting ${host} [${ESXIHOST}] into maintenance mode" >> ${PW_LOGFILE}
else