Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Last active November 8, 2018 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwenzel/42a0d00e4857ee9aa0c06740b365ae59 to your computer and use it in GitHub Desktop.
Save pwenzel/42a0d00e4857ee9aa0c06740b365ae59 to your computer and use it in GitHub Desktop.
Ping host and do something if it's down. Example showing how to use and/or operator in Fish shell
ping -q -c 1 bogus.local; and echo "pinging the host worked"; or echo "pinging the host didn't work"
ping -q -c 1 google.com; and echo "pinging the host worked"; or echo "pinging the host didn't work"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment