Update powerwall.sh

This commit is contained in:
2024-01-03 11:30:07 -06:00
parent a75afffbbe
commit 625b18c756

View File

@@ -753,32 +753,32 @@ fi
check) check)
([ "${2}" == "" ] || ([ "${2}" != "power" ] && [ "${2}" != "temp" ])) && checkrun="-help" || checkrun=${2} ([ "${2}" == "" ] || ([ "${2}" != "power" ] && [ "${2}" != "temp" ])) && checkrun="-help" || checkrun=${2}
if [ "${3}" == "" ]; then if [ "${3}" == "" ]; then
CHECKPOWER case ${checkrun} in
CHECKTEMP power) CHECKPOWER ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10};;
else temp) CHECKTEMP ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10};;
case ${checkrun} in all)
power) CHECKPOWER ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10};; CHECKTEMP ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10}
temp) CHECKTEMP ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10};; CHECKPOWER ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10}
-h|-help) ;;
echo -e "\nUsage: ${idsCL[Yellow]}[powerwall or pw] ${idsCL[LightYellow]}check ${idsCL[LightCyan]}{type} {flags} ${idsCL[Default]} {\n" -h|-help)
width=35 echo -e "\nUsage: ${idsCL[Yellow]}[powerwall or pw] ${idsCL[LightYellow]}check ${idsCL[LightCyan]}{type} {flags} ${idsCL[Default]} {\n"
printf "%-${width}s- %s\n" " {type}" "{power or temp} To check either power or temperatures" width=35
echo -e "\n ${idsCL[LightCyan]}power${idsCL[Default]} {flag} options" printf "%-${width}s- %s\n" " {type}" "{power or temp} To check either power or temperatures"
printf "%-${width}s- %s\n" " -a|-avg {#days}" "Show average values for X number of days" echo -e "\n ${idsCL[LightCyan]}power${idsCL[Default]} {flag} options"
printf "%-${width}s- %s\n" " -m|-mainsite" "Narrow to Mainsite Equipment" printf "%-${width}s- %s\n" " -a|-avg {#days}" "Show average values for X number of days"
printf "%-${width}s- %s\n" " -o|-offsite" "Narrow to Offsite Equipment" printf "%-${width}s- %s\n" " -m|-mainsite" "Narrow to Mainsite Equipment"
printf "%-${width}s- %s\n" " -p|-power" "Narrow to Power Equipment" printf "%-${width}s- %s\n" " -o|-offsite" "Narrow to Offsite Equipment"
printf "%-${width}s- %s\n" " -e|-esxi" "Narrow to ESXi Hosts" printf "%-${width}s- %s\n" " -p|-power" "Narrow to Power Equipment"
echo -e "\n ${idsCL[LightCyan]}temp${idsCL[Default]} {flag} options" printf "%-${width}s- %s\n" " -e|-esxi" "Narrow to ESXi Hosts"
printf "%-${width}s- %s\n" " -a|-avg {#days}" "Show average values for X number of days" echo -e "\n ${idsCL[LightCyan]}temp${idsCL[Default]} {flag} options"
printf "%-${width}s- %s\n" " -S|-sensors" "Narrow to Sensors Only" printf "%-${width}s- %s\n" " -a|-avg {#days}" "Show average values for X number of days"
printf "%-${width}s- %s\n" " -e|-esxi" "Narrow to ESXi Hosts Only" printf "%-${width}s- %s\n" " -S|-sensors" "Narrow to Sensors Only"
printf "%-${width}s- %s\n" " -s|-search" "Narrow to search of sensor name" printf "%-${width}s- %s\n" " -e|-esxi" "Narrow to ESXi Hosts Only"
echo -e "}\n" printf "%-${width}s- %s\n" " -s|-search" "Narrow to search of sensor name"
exit 0 echo -e "}\n"
;; exit 0
esac ;;
fi esac
;; ;;
test) test)
# while IFS=$'\t' read id date hum ;do # while IFS=$'\t' read id date hum ;do