Update powerwall.sh
This commit is contained in:
22
powerwall.sh
22
powerwall.sh
@@ -1140,6 +1140,27 @@ ISCSISYSVMSHUTDOWN(){
|
||||
echo
|
||||
}
|
||||
|
||||
HOSTPOWER(){
|
||||
if [ "${PW_iDRACHOST_SHORTNAMES[${1}]}" != "" ]; then
|
||||
idracip=${1}
|
||||
elif [ "${PW_HOST_IDRACS[${1}]}" != "" ]; then
|
||||
idracip=${PW_HOST_IDRACS[${1}]}
|
||||
else
|
||||
idracip=''
|
||||
fi
|
||||
|
||||
if [ "${idracip}" != "" ]; then
|
||||
if [ "${2,,}" == "on" ] || [ "${2,,}" == "off" ] || [ "${2,,}" == "status" ]; then
|
||||
ssh root@${PW_RACADM_ACCESS} ipmitool -I lanplus -H ${idracip} -U ${PW_ESXI_USER} -P "'${PW_ESXI_PASS}'" chassis power ${2,,}
|
||||
else
|
||||
echo -e "${idsCL[LightCyan]}'${2,,}' command is not recognized${idsCL[Default]}"
|
||||
fi
|
||||
else
|
||||
echo -e "${idsCL[LightCyan]}Host does not exist${idsCL[Default]}"
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
LOGROTATE(){
|
||||
# STOPALL_SERVICES
|
||||
lm=`expr $(date +'%m') - 1`
|
||||
@@ -1248,6 +1269,7 @@ fi
|
||||
;;
|
||||
shutdownhost) SHUTDOWN_SERVER ${2};;
|
||||
shutdown_servers) SHUTDOWN_SERVERS ${2};;
|
||||
hostpower) HOSTPOWER ${2} ${3};;
|
||||
|
||||
get-snapshots) GET_SNAPSHOTS;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user