Skip to content

Instantly share code, notes, and snippets.

@n1mh
Last active November 30, 2016 10:26
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 n1mh/00bb7e8bd9e4ec99aaaf9cee08034093 to your computer and use it in GitHub Desktop.
Save n1mh/00bb7e8bd9e4ec99aaaf9cee08034093 to your computer and use it in GitHub Desktop.
check connection from an IP
#!/bin/bash
curl -s ifconfig.me
curl -s 'https://api.ipify.org'
curl -s 'http://ipv4bot.whatismyipaddress.com/'
#!/bin/bash
# check if web is up
curl -s 'http://www.isup.me/n1mh.com' | grep -c "It's just you"
#!/bin/bash
# check if my ip is up
# - requires: curl
# - output: OK if IP is up, KO if not.
IP=`curl -s 'https://api.ipify.org'` && ( curl -s "http://www.isup.me/$IP" | grep -cq "It's just you" && echo 'OK' ) || echo 'KO'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment