Update powerwall.sh

This commit is contained in:
2023-10-31 09:47:47 -05:00
parent 43ae047fb3
commit 62236d1d06

View File

@@ -598,17 +598,19 @@ CHECKPOWER(){
for hostfile in ${PW_TMPFOLDER}/*.hostpower; do
if [ -f ${hostfile} ] && [ "${hostfile}" != "${PW_TMPFOLDER}/*.hostpower" ]; then
host=${hostfile%.*}; host=${host##*/}
if [ "${host}" != "*" ]; then
if [ "${host}" != "*" ] && [ "${host}" != "done" ]; 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
elif [ "${host}" == "done" ]; then
checked=done
rm -f ${PW_TMPFOLDER}/*.hostpower*
fi
fi
done
[ -f ${PW_TMPFOLDER}/done.hostpower ] && checked=done
done
rm -f ${PW_TMPFOLDER}/*.hostpower*
[ "${action}" != "" ] && echo
}