separate stat procedure

This commit is contained in:
Yifan Gao 2017-01-26 02:57:58 +08:00
parent e35b0dc24c
commit 07dcc964cc
3 changed files with 19 additions and 18 deletions

View File

@ -12,6 +12,7 @@ before_script:
- docker pull gaoyifan/bgpdump
script:
- ./generate.sh
- ./stat.sh
deploy:
provider: script
script: ./upload.sh

View File

@ -41,21 +41,3 @@ while read file; do
get_asn $file | xargs bgptools | docker run -i --rm gaoyifan/cidrmerge > result/$operator.txt
>&2 echo "done"
done
# count the number of IP
cd result
ls *.txt |
while read file; do
echo ${file%.*}
cat $file |
awk -F\/ '{print $2}' |
(
sum=0
while read n; do
((s=32-n))
((sum+=1<<s))
done
echo $sum
)
echo
done > stat

18
stat.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
cd result
ls *.txt |
while read file; do
echo ${file%.*}
cat $file |
awk -F\/ '{print $2}' |
(
sum=0
while read n; do
((s=32-n))
((sum+=1<<s))
done
echo $sum
)
echo
done > stat