Skip to content

Commit

Permalink
Create pingreboot.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
krzee authored Sep 24, 2019
1 parent 7895659 commit 4b2e6a9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pingreboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/system/bin/sh

[[ -f /sdcard/pingreboot ]] || exit
c=0

while :; do
if ping -c 1 1.1.1.1 > /dev/null
then
c=0
else
log -t ProtoWifi "network failure"
svc wifi disable
sleep 4
svc wifi enable
c=$((c+1))
(( $c > 10 )) && reboot
fi
sleep 30
done

0 comments on commit 4b2e6a9

Please sign in to comment.