#!/bin/sh
MonitorIP=6.6.6.222
DelayTime=30s
if ping $MonitorIP -W 2 -w 2 -c 2 | grep '^[0-9].*ms$' > /dev/null
then
echo "Power on."
else
synologset1 sys warn 0x11600036
sleep $DelayTime
if ping $MonitorIP -W 2 -w 2 -c 2 | grep '[0-9].*ms$' > /dev/null
then
synologset1 sys warn 0x11600035
else
synologset1 sys warn 0x11600037
poweroff
fi
fi
exit 0
|
|