Update powerwall.sh

This commit is contained in:
2024-01-13 23:19:25 -06:00
parent daac50b135
commit f078187610

View File

@@ -477,7 +477,7 @@ HOSTMGMT(){
DIVIDER . yellow 75
HOST=${1}
if [ "${HOST}" != "-h" ] && [ "${HOST}" != "" ]; then
if [ "${HOST,,}" != "-s" ] && [ "${HOST,,}" != "-status" ] && [ "${HOST,,}" != "-h" ] && [ "${HOST,,}" != "-help" ] && [ "${HOST}" != "" ]; then
cHOST=${HOST}
MN=0
if [ "${PW_iDRACHOST_SHORTNAMES[${HOST}]}" != "" ]; then
@@ -515,12 +515,20 @@ HOSTMGMT(){
idracip=${PW_HOST_IDRACS[${tmp}]}
hostname=${PW_iDRACHOST_SHORTNAMES[${idracip}]}
fi
elif [ "${HOST,,}" == "-s" ] && [ "${HOST,,}" == "-status" ]; then
for ESXIHOST in "${PW_ALLHOSTS[@]}"; do
echo ${ESXIHOST}
done
exit 0
else
echo -e "Usage: ${idsCL[Yellow]}pw host {host} {flags}${idsCL[Default]} {"
width=35
printf "%-${width}s- %s\n" " {host}" "(*required, can either be esxiIP,idracIP or Host#)"
printf "%-${width}s- %s\n" " {host}" "(*required if not uing -s, can either be esxiIP,idracIP or Host#)"
printf "%-${width}s- %s\n" " -p|-power {on / off}" "Controls Host Power"
printf "%-${width}s- %s\n" " -e|-esxi {off / mm}" "Shuts down ESXi or puts into maintenance mode"
printf "%-${width}s- %s\n" " -s|-status" "List all Host's Status"
echo -e "}\n"
exit 0
fi
@@ -528,15 +536,6 @@ HOSTMGMT(){
case "$1" in
-p|-power) POWER=${2}; MODE="power";;
-e|-esxi) ESXI=${2}; MODE="esxi";;
-h|-help)
echo -e "Usage: ${idsCL[Yellow]}pw host {host} {flags}${idsCL[Default]} {"
width=35
printf "%-${width}s- %s\n" " {host}" "(*required, can either be esxiIP,idracIP or Host#)"
printf "%-${width}s- %s\n" " -p|-power {on / off}" "Controls Host Power"
printf "%-${width}s- %s\n" " -e|-esxi {off / mm}" "Shuts down ESXi or puts into maintenance mode"
echo -e "}\n"
exit 0
;;
esac
shift 1
done