Update powerwall.sh

This commit is contained in:
2023-10-31 09:41:14 -05:00
parent 4c051f8d5c
commit 0c953ba5c6

View File

@@ -595,15 +595,13 @@ CHECKPOWER(){
# done
until [ "${checked}" != "" ]; do
for hostfile in "${PW_TMPFOLDER}/*.hostpower"; do
if [ -f ${hostfile} ]; then
for hostfile in ${PW_TMPFOLDER}/*.hostpower; do
if [ -f ${hostfile} ] && [ "${hostfile}" != ${PW_TMPFOLDER}/*.hostpower ]; then
host=${hostfile%.*}; host=${host##*/}
if [ "${host}" != "*" ]; then
watts=$(cat ${hostfile})
# echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}HOST '${host}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}"
mv ${hostfile} ${hostfile}.done
fi
watts=$(cat ${hostfile})
# echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}HOST '${host}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}"
mv ${hostfile} ${hostfile}.done
fi
done
[ -f ${PW_TMPFOLDER}/done.hostpower ] && checked=done