Update powerwall.sh

This commit is contained in:
2023-12-11 22:39:12 -06:00
parent bc82ccd463
commit 1086e97fd2

View File

@@ -21,6 +21,8 @@ CHECKTEMP(){
while [ $# -gt 0 ]; do
case "$1" in
-a|-avg) avgdays=${2};;
-S|-sensors) temptype="sensors";;
-e|-esxi) temptype="esxi";;
-s|-search) search=${2};;
esac
shift 1
@@ -39,7 +41,7 @@ CHECKTEMP(){
if [ "${search}" == "" ] || [[ "${SENSOR,,}" = *"${search,,}"* ]]; then
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ] && [ "${temptype}" != "sensors" ]; then
vHOSTiDRACIP=${PW_HOST_IDRACS[${SENSOR}]}
vHOSTIP=${PW_HOST_ADDRESSES[${SENSOR}]}
vHOSTNAME=${PW_ESXI_HOST_NAMES[${vHOSTiDRACIP}]}
@@ -85,7 +87,7 @@ CHECKTEMP(){
# fi
fi
else
elif [ "${temptype}" != "esxi" ]; then
[[ "${SENSOR}" == *"CPU-Usage"* ]] && echo -en "\033[1A"
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}"