mirror of
https://gitlab.com/GameFeverOnline/apcupsd-watts.git
synced 2025-12-17 01:17:40 -04:00
first commit
This commit is contained in:
parent
9e5936ac56
commit
952e61a153
1 changed files with 10 additions and 0 deletions
10
percent_load_2_watts-short_ups_fix.sh
Executable file
10
percent_load_2_watts-short_ups_fix.sh
Executable 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue