From 62236d1d0658adf843f8af590a30c21ae58a0531 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 31 Oct 2023 09:47:47 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index a6667afd..d7a50178 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -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 }