Skip to content

Instantly share code, notes, and snippets.

@DarthNerdus
Created November 2, 2019 03:05
Show Gist options
  • Save DarthNerdus/29fb6806f5a9f64326ed7fdedef921c5 to your computer and use it in GitHub Desktop.
Save DarthNerdus/29fb6806f5a9f64326ed7fdedef921c5 to your computer and use it in GitHub Desktop.
#!/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