Created
December 12, 2016 19:06
-
-
Save hugodias/4dca800ecde938c94a047c9d80dbb6aa to your computer and use it in GitHub Desktop.
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/sh | |
| if [[ $# -eq 0 ]] ; then | |
| echo 'Usage: blog-checkup someblog.com' | |
| exit 0 | |
| fi | |
| # 1st get the bloddy IP address | |
| #ip=`dig +short $1` | |
| ip=`ping -c1 $1|head -n1|egrep --color="never" -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'` | |
| echo "-- IP Address ------------------------------------------------------------" | |
| echo "$ip" | |
| # 2nd shows the result of the DNS reverse lookup | |
| echo "-- DNS Reverse lookup ----------------------------------------------------" | |
| reverse_lookup=`dig -x $ip` | |
| echo "$reverse_lookup" | |
| # 3rd try a simple POST request on xmlrpc.php | |
| echo "-- xmlrpc.php http status ------------------------------------------------" | |
| post_result=`curl --data t=1 -s -o /dev/null -w "%{http_code}" $1/xmlrpc.php` | |
| if [ "$post_result" = "200" ]; then | |
| echo "HTTP STATUS [$post_result] OK -> xmlrpc success response" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment