Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you want to run above script at AsusWRT, you will need to modify the first line as following

Code Block
#!/bin/sh


Below code works more accurately at AsusWRT

Code Block
languagebash
title/jffs/scripts/reboot_if_ping_does_not_work
#!/bin/ash

if [ $( ping -c 1 google.com | grep ttl | wc -l ) -eq 0 ]
then
        echo noreply
        /sbin/reboot
else
        echo "google.com is reachable"
fi