#!/bin/sh
Gateway=192.168.0.80
time=3m
while [ 1 ]; do
ping -c 1 $Gateway
if [ $? -ne 0 ];then
echo Maybe poweroff or Router reboot, wait $time ...
sleep $time
ping -c 1 $Gateway
if [ $? -ne 0 ];then
echo Poweroff and shutdown
sleep 5s
poweroff
else
echo Router has rebooted!
fi
fi
sleep $time
done











网友评论