Last active
November 8, 2016 10:19
-
-
Save techouse/1edbc54005238e334e76e909e2f48ff4 to your computer and use it in GitHub Desktop.
Protected SKY IP checker. Check if the given IP is blacklisted via http://psky.me/
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 [[ -z $1 ]] ; then | |
echo "psky.sh <IP>" | |
echo "" | |
echo "Protected SKY IP checker" | |
echo "Check if the given IP is blacklisted" | |
echo "" | |
return 1; | |
fi | |
REVERSE=$(echo $1 | awk -F '.' '{ print $4 "." $3 "." $2 "." $1 }') | |
STATUS=$(dig $REVERSE.bad.psky.me +short $1) | |
if [ "$STATUS" == "NOERROR" ] ; then | |
echo "OK"; | |
elif [ "$STATUS" == "127.0.0.2" ] || [ "$STATUS" == "127.0.0.3" ] ; then | |
echo "SPAM"; | |
else | |
echo "UNKNOWN"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment