You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I leave this issue, for myself and someone else with time and desire to write or improve?
what i do now in shell, and would be nice feature in grepcidr.
Perfectly fine speed wise with more than 2000 lines and addres block that matches 5 as top hit, not sure if its misses or catches all, but should..
And well, i use prips to print out blocks /25 and smaller, which could be an option as it would be more lines with square scaling without.
sanitize_cidr() {
file="$1"
overlaps=$(cat $file | while read line ; do
echo "$(grepcidr -D $line $file | wc -l) $line\n"
done | sort -r)
N=$(echo -e $overlaps | awk 'NR==1{print $1}')
# start with lowest N cidr with overlaps to highest in case they are nested.
for i in $(seq 2 $N) ; do
echo -e $overlaps | grep "$i\s" | awk '{print$2}' | while read line ;do
cidr_remove=$(grepcidr -D $line $file | sort -t "/" -k2 | tail -n+2 | sed -e 's/[]\/$*.^[]/\\&/g')
for i in $cidr_remove ;do
sed -i "/$i/d" $file
done
done
done
}
The text was updated successfully, but these errors were encountered:
If you want to combine overlaping IP ranges, it's easy to do in a tiny script using the standard python ipaddress library, and probably other language libraries too. There's no need to add a wart to this program.
Like I said, this would be easy to do in a python script using the standard python ipaddress module. I am not going to add it to grepcidr.
If you don't have sufficient python skills and this is important to you, I'm sure you can find someone who'll program it for you, probably not for free.
Can I leave this issue, for myself and someone else with time and desire to write or improve?
what i do now in shell, and would be nice feature in grepcidr.
Perfectly fine speed wise with more than 2000 lines and addres block that matches 5 as top hit, not sure if its misses or catches all, but should..
And well, i use prips to print out blocks /25 and smaller, which could be an option as it would be more lines with square scaling without.
The text was updated successfully, but these errors were encountered: