diff --git a/inc/power.inc.sh b/inc/power.inc.sh index a5080117..205d224b 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -306,8 +306,11 @@ CHECKPOWER(){ if [ "${PW_OFFSITE_MONITOR}" = "$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)" ]; then upsinfo=$(upsc CP1500PFCLCD 2>&1) + echo NO else + echo YES upsinfo=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${PW_OFFSITE_MONITOR} 'upsc CP1500PFCLCD' 2>&1) + echo ${upsinfo} fi if [ "$(echo "${upsinfo}" | grep 'input.voltage:')" != "" ]; then OFFSITE_STATUS=$(echo "${upsinfo}" | grep 'ups.status:' | sed 's/.*: //')