2016-11-26 6 views

답변

0

가 완료 :

#!/bin/bash 

# define AS to block 
as=(AS1111 
AS2222 
) 

# define output 
output=('create block hash:net family inet hashsize 1024 maxelem 1024') 

# build list of subnets 
for i in "${as[@]}" 
do 
     echo $i 
     output+=(`whois -h whois.radb.net -- "-i origin $i" | grep -Eo "([0-9.]+){4}/[0-9]+" | head`) 
done 

# dump output to file 
printf '%s\n' "${output[@]}" > /etc/sysconfig/ipset 

exit 0