Last active
November 30, 2016 10:26
-
-
Save n1mh/00bb7e8bd9e4ec99aaaf9cee08034093 to your computer and use it in GitHub Desktop.
check connection from an IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -s ifconfig.me | |
curl -s 'https://api.ipify.org' | |
curl -s 'http://ipv4bot.whatismyipaddress.com/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check if web is up | |
curl -s 'http://www.isup.me/n1mh.com' | grep -c "It's just you" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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