This commit is contained in:
2023-12-22 08:42:12 -06:00
parent 37d7612397
commit 622eda7c9e
2 changed files with 19 additions and 17 deletions

View File

@@ -708,14 +708,14 @@ HOSTPOWER(){
fi
if [ "${TEST}" != "true" ]; then
current_status=$(ipmitool -I lanplus -H ${idracip} -U ${PW_ESXI_USER} -P "${PW_ESXI_PASS}" chassis power status | grep 'Power is on')
# if [ "${current_status}" == "" ]; then
current_status=$(ipmitool -I lanplus -H ${idracip} -U ${PW_ESXI_USER} -P "${PW_ESXI_PASS}" chassis power status | grep 'Power is ${2,,}')
if [ "${current_status}" == "" ]; then
echo -e "${idsCL[Green]}"
ipmitool -I lanplus -H ${idracip} -U ${PW_ESXI_USER} -P "${PW_ESXI_PASS}" chassis power ${2,,}
# else
# echo -e "\n${idsCL[LightCyan]}Host is already Powered ON${idsCL[Default]}"
#
# fi
else
echo -e "\n${idsCL[LightCyan]}Host is already Powered ${2^^}${idsCL[Default]}"
fi
else
echo -e "\n${idsCL[Yellow]}(TEST MODE)"
fi