#!/usr/bin/env bash

set -e
source common.sh
[[ $SKIP_DATA_PREPARATION != true ]] && prepare_data
mkdir -p result
for file in operator/*.conf; do
	operator=${file%.*}
	operator=${operator##*/}
	log_info "generating IP list of $operator ..."
	get_asn $file
	get_asn $file | xargs bgptools -b rib.txt  | cidr-merger > result/${operator}.txt &
	get_asn $file | xargs bgptools -b rib6.txt | cidr-merger > result/${operator}6.txt &
done

wait

#!/usr/bin/env bash

set -e
source common.sh
[[ $SKIP_DATA_PREPARATION != true ]] && prepare_data
mkdir -p result
for file in operator/*.conf; do
	operator=${file%.*}
	operator=${operator##*/}
	log_info "generating IP list of $operator ..."
	get_asn $file
	get_asn $file | xargs bgptools -b rib.txt  | cidr-merger -s > result/${operator}.txt &
	get_asn $file | xargs bgptools -b rib6.txt | cidr-merger -s > result/${operator}6.txt &
done

wait

Fix single IP address format
Fix single IP address format

ex:
1.1.1.1/32 -> cidrmerge
1.1.1.1 -> cidr-merger
1.1.1.1/32 -> cidr-merger -s
