first commit

This commit is contained in:
Timothy GFO 2023-12-01 19:32:37 -04:00
parent 9e5936ac56
commit 952e61a153

View file

@ -0,0 +1,10 @@
#!/bin/bash
#Created by Timothy GFO at March 10, 2023, improved on December 1, 2023
PERCENT=$(apcaccess -pLOADPCT | sed 's/Percent//')
PERCENTINT=$(bc <<< "$PERCENT/1")
UPSMAXWATTS=$(apcaccess -pNOMPOWER | sed 's/Watts//')
UPSMAXWATTSINT=$(bc <<< "$UPSMAXWATTS/1")
watts=$(($PERCENTINT * $UPSMAXWATTSINT / 100))
echo $watts watts