Skip to content

Instantly share code, notes, and snippets.

@spot62
Last active September 12, 2018 15:03
Show Gist options
  • Save spot62/42e936ec418db6a48c138197ea16fa97 to your computer and use it in GitHub Desktop.
Save spot62/42e936ec418db6a48c138197ea16fa97 to your computer and use it in GitHub Desktop.
inline http check as ping
ok=0; err=0; for ((;;)) do curl ${yourip} > /dev/null 2>&1 && { ((ok++)); err=0; echo -en "ok $ok\r"; } || { r=$?; ok=0; ((err++)); echo "error:$r $err"; } ; sleep 1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment