You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Below script makes server to reboot if ping does not work

#/bin/bash
:Begin
ping -c 10 google.com
If %errorlevel% == 1 (
        echo noreply
        shutdown -r -t 0
)
If %errorlevel% == 0 (
        GoTo :End
)
:End

In my case, I run above scripts by crone job in every 10 mins.

  • No labels