make POSIX sh compliant

This commit is contained in:
2025-12-18 14:12:29 -08:00
parent 1f48d9808c
commit cdae221acf
11 changed files with 63 additions and 20 deletions

View File

@ -1,10 +1,10 @@
#!/bin/sh
# for UPS monitoring with pwrstatd
# for UPS monitoring with NUT
#
#POWER="$(pwrstat -status | grep "Load" | awk '{print $2}')W"
#CHARGE=$(pwrstat -status | grep "Battery Capacity" | awk '{print $3$4}')
#if [[ "$CHARGE" == "100%" ]]; then
#POWER="$(upsc titanium-power@localhost | grep ups.realpower: | awk '{print $2}')W"
#CHARGE="$(upsc titanium-power@localhost | grep battery.charge: | awk '{print $2}')%"
#if [ "$CHARGE" = "100%" ]; then
# echo $POWER
#else
# echo "$CHARGE $POWER"