Update offsite-power-check.sh

This commit is contained in:
2023-11-05 15:27:48 -06:00
parent 5a4c24d51d
commit df2fd8d4af

View File

@@ -27,12 +27,12 @@ $(date)"
else
PRIORITY=0
fi
echo "Sending message"
curl -d "token=${PUSHOVER_APP_TOKEN}&user=${PUSHOVER_USER_TOKEN}&message=${MESSAGE}&title=${TITLE}&priority=${PRIORITY}&sound=${MSGSOUND}" https://api.pushover.net/1/messages.json
}
while true; do
upsinfo=$(upsc CP1500PFCLCD)
echo "HERE: ${upsinfo}"
if [ "${upsinfo}" != "Error: Connection failure: Connection refused" ]; then
OFFSITE_VOLTIN=$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')
OFFSITE_BATT_RUNTIME=$(echo "${upsinfo}" | grep 'battery.runtime:' | sed 's/.*: //')