Created
November 2, 2019 03:05
-
-
Save DarthNerdus/29fb6806f5a9f64326ed7fdedef921c5 to your computer and use it in GitHub Desktop.
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
#!/system/bin/sh | |
[[ -f /sdcard/pingreboot ]] || exit | |
c=0 | |
while :; do | |
if ping -c 1 1.1.1.1 > /dev/null | |
then | |
c=0 | |
log -t ProtoWifi "network passing" | |
else | |
log -t ProtoWifi "network failure" | |
ifconfig eth0 down | |
sleep 4 | |
ifconfig eth0 up | |
c=$((c+1)) | |
(( $c > 5 )) && reboot | |
fi | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment