Created
July 5, 2017 12:44
-
-
Save ivanhuay/88a76b48feb4661922592a905113c768 to your computer and use it in GitHub Desktop.
scrypt for search country of ips files
This file contains 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 | |
FILE=$1 | |
if [ -f $FILE ]; | |
then | |
while read line | |
do | |
resp=`curl -s "http://freegeoip.net/json/$line"|grep -Eo "\"country_name\":\"[a-zA-Z\ ]{4,50}\""` | |
echo "$line $resp" | |
done <"$FILE" | |
else | |
echo "File $FILE does not exist." | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment