Shutdown if ping fails


Recommended Posts

I want to make Unraid machine able to shutdown itself when ping to router fails after 5 retries during 25 minutes (my cheap UPS can handle it)

How to do that?

ping -c 5 -i 300 192.168.0.1 || poweroff

works not good because if ping is successful then interval before next attempt 5 minutes anyway.

Edited by Nuke
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.