Created
August 26, 2015 05:22
-
-
Save idy/2ac91c8f73e944653016 to your computer and use it in GitHub Desktop.
create ipset from isp cidr txt
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
ipset destroy; | |
for isp in ./*.txt; > ipset.sh | |
do | |
isp_name=`basename $isp .txt`; | |
echo "#$isp_name"; | |
echo "ipset create $isp_name hash:net"; | |
for cidr in `cat $isp`; | |
do | |
echo "ipset add $isp_name $cidr"; | |
done; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment