Update offsite-power-check.sh
This commit is contained in:
@@ -43,7 +43,6 @@ fi
|
|||||||
PWO_START(){
|
PWO_START(){
|
||||||
startup=true
|
startup=true
|
||||||
while true; do
|
while true; do
|
||||||
SENDNOTICE "OFFSITE POWER MONITOR" "Service starting"
|
|
||||||
upsinfo=$(upsc CP1500PFCLCD)
|
upsinfo=$(upsc CP1500PFCLCD)
|
||||||
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
|
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
|
||||||
OFFSITE_VOLTIN=$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')
|
OFFSITE_VOLTIN=$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')
|
||||||
@@ -60,8 +59,9 @@ BATTERY CHARGE: ${OFFSITE_BATT_CAP}%25
|
|||||||
BATT RUNTIME: ${OFFSITE_BATT_RUNTIME}'mins
|
BATT RUNTIME: ${OFFSITE_BATT_RUNTIME}'mins
|
||||||
AC VOLTAGE: ${OFFSITE_VOLTIN}'volts"
|
AC VOLTAGE: ${OFFSITE_VOLTIN}'volts"
|
||||||
if [ "${3}" = "1" ]; then PRIORITY="${3}"; MSGSOUND=siren; elif [ "${3}" != "" ]; then PRIORITY=${3}; else PRIORITY=0; fi
|
if [ "${3}" = "1" ]; then PRIORITY="${3}"; MSGSOUND=siren; elif [ "${3}" != "" ]; then PRIORITY=${3}; else PRIORITY=0; fi
|
||||||
curl -sd "token=${PUSHOVER_APP_TOKEN}&user=${PUSHOVER_USER_TOKEN}&message=${MESSAGE}&title=${1}&priority=${PRIORITY}&sound=cosmic" https://api.pushover.net/1/messages.json >/dev/null 2>&1
|
curl -sd "token=${PUSHOVER_APP_TOKEN}&user=${PUSHOVER_USER_TOKEN}&message=${MESSAGE}&title=${1}&priority=${PRIORITY}&sound=cosmic" https://api.pushover.net/1/messages.json #>/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
SENDNOTICE "TEST" "Testies 123"
|
||||||
if [ "${startup}" == "true" ]; then
|
if [ "${startup}" == "true" ]; then
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Service startup" >> ${PW_LOGPOWER}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Service startup" >> ${PW_LOGPOWER}
|
||||||
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Service startup" >> ${PW_LOGFILE}
|
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Service startup" >> ${PW_LOGFILE}
|
||||||
|
|||||||
Reference in New Issue
Block a user