I need to see if few IP addresses are in a specific country this is what I got so far
#!/bin/bash
## $1 ip $2 country
## -i is a singal ip i need to get the ip file in a loop or find a different command
dmitry -i $1 -o ipa.txt
x=$(cat ipa | grep country | awk '{print $2}')
## if the ip is from the country i specified then it will go to a new list
if [ "$x" == "$2" ]; then
echo $1 >> ips.txt
fi
Aucun commentaire:
Enregistrer un commentaire