Skip to content

Instantly share code, notes, and snippets.

@hugodias
Created December 12, 2016 19:06
Show Gist options
  • Select an option

  • Save hugodias/4dca800ecde938c94a047c9d80dbb6aa to your computer and use it in GitHub Desktop.

Select an option

Save hugodias/4dca800ecde938c94a047c9d80dbb6aa to your computer and use it in GitHub Desktop.
#!/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