Update powerwall.sh
This commit is contained in:
11
powerwall.sh
11
powerwall.sh
@@ -622,10 +622,13 @@ CHECKPOWER(){
|
|||||||
host=${hostfile%.*}; host=${host##*/}
|
host=${hostfile%.*}; host=${host##*/}
|
||||||
if [ "${host}" != "*" ] && [ "${host}" != "done" ]; then
|
if [ "${host}" != "*" ] && [ "${host}" != "done" ]; then
|
||||||
watts=$(cat ${hostfile})
|
watts=$(cat ${hostfile})
|
||||||
[[ "${watts}" == *"."* ]] && [[ "${watts}" != *".0"* ]] && watts=`printf "%'.1f\n" ${watts}` || watts=`printf "%'.0f\n" ${watts}`
|
if [ "${watts}" == "down" ]; then
|
||||||
if [ "${watts}" == "down" ]; then hostpower="${idsCL[Red]}Host Offline"
|
hostpower="${idsCL[Red]}Host Offline"
|
||||||
elif [ "${watts}" == "0" ]; then hostpower="${idsCL[Default]}n/a"
|
elif [ "${watts}" == "0" ]; then
|
||||||
else hostpower="${idsCL[Green]}${watts}'W"
|
hostpower="${idsCL[Default]}n/a"
|
||||||
|
else
|
||||||
|
[[ "${watts}" == *"."* ]] && [[ "${watts}" != *".0"* ]] && watts=`printf "%'.1f\n" ${watts}` || watts=`printf "%'.0f\n" ${watts}`
|
||||||
|
hostpower="${idsCL[Green]}${watts}'W"
|
||||||
fi
|
fi
|
||||||
echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${hostpower}${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${hostpower}${idsCL[Default]}"
|
||||||
mv ${hostfile} ${hostfile}.done
|
mv ${hostfile} ${hostfile}.done
|
||||||
|
|||||||
Reference in New Issue
Block a user