Jump to content


Photo

Reboot script on fail to ping


  • Please log in to reply
3 replies to this topic

#1 nhg

  • Member
  • 40 posts

+1
Neutral

Posted 13 July 2012 - 18:40

Hey is there anybody that know a script that will reboot when the box fails to ping it self or the router?

Thanks

Re: Reboot script on fail to ping #2 MiLo

  • PLi® Core member
  • 14,052 posts

+298
Excellent

Posted 13 July 2012 - 18:47

ping 192.168.1.1 || reboot

Real musicians never die - they just decompose

Re: Reboot script on fail to ping #3 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 13 July 2012 - 19:11

I think you may need to add a -c count for busybox' ping, otherwise it'll just keep attempting to ping forever. Something like:

ping -c 2 192.168.1.1 || reboot

--
hemi

Re: Reboot script on fail to ping #4 nhg

  • Member
  • 40 posts

+1
Neutral

Posted 14 July 2012 - 07:56

Super thanks I works :)


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users