Versions Compared

Key

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


Excerpt

Sometimes servers need to update its status or reboot by the condition to return its status to the best working environment to remove junk process or something like that. You can check that status by shell script.


Below script makes server to reboot if ping does not work:

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

...