Created
October 22, 2020 02:09
-
-
Save ety001/4546b7846aceb67195fb0a39c38bb6c3 to your computer and use it in GitHub Desktop.
openwrt reconnect shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PING=`ping -c 5 114.114.114.114|grep -v grep|grep '64 bytes' |wc -l` | |
if [ ${PING} -ne 0 ];then | |
exit 0 | |
else | |
/etc/init.d/network restart | |
fi | |
sleep 10 | |
PING2=`ping -c 5 114.114.114.114|grep -v grep|grep '64 bytes' |wc -l` | |
if [ ${PING2} -ne 0 ];then | |
exit 0 | |
else | |
reboot | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment