From baa0fe1448c3910fa1f22575c0782524cc96a3e1 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 31 Oct 2023 09:27:57 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index efd0476f..08a8654d 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -594,11 +594,13 @@ CHECKPOWER(){ until [ "${checked}" != "" ]; do for hostfile in "${PW_TMPFOLDER}/*.hostpower"; do - host=${hostfile%.*}; host=${host##*/} - echo "HERE: $host = $hostfile" - watts=$(cat ${hostfile}) - echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}" - rm -f ${hostfile} + if [ -f ${hostfile} ]; then + host=${hostfile%.*}; host=${host##*/} + echo "HERE: $host = $hostfile" + watts=$(cat ${hostfile}) + echo -e "${idsCL[LightCyan]}HOST '${PW_iDRACHOST_SHORTNAMES[${host}]}' ${idsCL[Default]}: ${idsCL[Green]}${watts}W${idsCL[Default]}" + rm -f ${hostfile} + fi done if [ -f ${PW_TMPFOLDER}/done.hostpower ]; then checked=done