china-operator-ip/generate.sh
Yifan Gao ea485fe7e4 refact shell script
* fix wget save to a wrong file name with a same name file
* beautify log format
* print asn on log
* modify/add DEBUG, SKIP_DATA_PREPARATION environment variables
2017-03-10 21:52:04 +08:00

15 lines
385 B
Bash
Executable File

#!/usr/bin/env bash
source common.sh
set -e
[[ $SKIP_DATA_PREPARATION != true ]] && prepare_data
mkdir -p result
ls operator/*.conf |
while read file; do
operator=${file%.*}
operator=${operator##*/}
log_info "generating IP list of $operator ..."
get_asn $file | tee /dev/stderr | xargs bgptools | docker run -i --rm gaoyifan/cidrmerge > result/$operator.txt
log_info "done"
done