mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 21:29:29 +02:00
#707 added ups info to screen
This commit is contained in:
parent
47d80cf7a4
commit
86839947ac
@ -15,6 +15,16 @@ color_purple='\033[0;35m'
|
||||
source /home/admin/raspiblitz.info 2>/dev/null
|
||||
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||
|
||||
# get UPS info
|
||||
source <(/home/admin/config.scripts/blitz.ups.sh status)
|
||||
upsInfo=""
|
||||
if [ "${upsStatus}" = "ONLINE" ]; then
|
||||
upsInfo="${color_gray}${upsBattery}"
|
||||
fi
|
||||
if [ "${upsStatus}" = "ONBATT" ]; then
|
||||
upsInfo="${color_red}${upsBattery}"
|
||||
fi
|
||||
|
||||
# check hostname
|
||||
if [ ${#hostname} -eq 0 ]; then hostname="raspiblitz"; fi
|
||||
|
||||
@ -287,7 +297,7 @@ printf "
|
||||
${color_yellow}
|
||||
${color_yellow}
|
||||
${color_yellow}
|
||||
${color_yellow} ${color_amber}%s ${color_green} ${ln_alias}
|
||||
${color_yellow} ${color_amber}%s ${color_green} ${ln_alias} ${upsInfo}
|
||||
${color_yellow} ${color_gray}${network} Fullnode + Lightning Network ${torInfo}
|
||||
${color_yellow} ,/ ${color_yellow}%s
|
||||
${color_yellow} ,'/ ${color_gray}%s, temp %s°C %s°F
|
||||
|
@ -79,12 +79,11 @@ if [ "$1" = "status" ]; then
|
||||
if [ ${#status} -eq 0 ]; then
|
||||
echo "upsStatus='n/a'"
|
||||
else
|
||||
echo "upsStatus='${status}'"
|
||||
# get battery level if possible
|
||||
if [ "${status}" = "ONLINE" ] || [ "${status}" = "ONBATT" ]; then
|
||||
status=$(apcaccess -p BCHARGE | xargs | cut -d "." -f1)
|
||||
echo "upsStatus='${status}%'"
|
||||
else
|
||||
echo "upsStatus='${status}'"
|
||||
battery=$(apcaccess -p BCHARGE | xargs | cut -d "." -f1)
|
||||
echo "upsBattery='${battery}%'"
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user