From 052696c5b514a3722062b85e0a907554096eb64c Mon Sep 17 00:00:00 2001 From: Yifan Gao Date: Sun, 28 Jun 2020 20:41:21 +0800 Subject: [PATCH] Reformat code --- common.sh | 30 +++++++++++++++--------------- stat.sh | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common.sh b/common.sh index ac1ccf39..54d309a3 100755 --- a/common.sh +++ b/common.sh @@ -3,7 +3,7 @@ [[ $DEBUG == true ]] && set -x log_info(){ - >&2 echo "INFO>" $@ + >&2 echo "INFO>" $@ } get_asn(){ @@ -35,21 +35,21 @@ prepare_data_v6(){ log_info "finish bgpdump v6" } prepare_data(){ - curl -sSL https://bgp.potaroo.net/cidr/autnums.html | awk '-F[<>]' '{print $3,$5}' | grep '^AS' > asnames.txt & - prepare_data_v4 & - prepare_data_v6 & - wait_exit + curl -sSL https://bgp.potaroo.net/cidr/autnums.html | awk '-F[<>]' '{print $3,$5}' | grep '^AS' > asnames.txt & + prepare_data_v4 & + prepare_data_v6 & + wait_exit } wait_exit(){ - local oldstate=$(set +o) - set +e - local s=0 - while [[ $s -ne 127 ]]; do - [[ $s -ne 0 ]] && exit $s - wait -n - s=$? - done - eval "$oldstate" - return 0 + local oldstate=$(set +o) + set +e + local s=0 + while [[ $s -ne 127 ]]; do + [[ $s -ne 0 ]] && exit $s + wait -n + s=$? + done + eval "$oldstate" + return 0 } diff --git a/stat.sh b/stat.sh index 6b163346..48cfe51e 100755 --- a/stat.sh +++ b/stat.sh @@ -5,11 +5,11 @@ cd result for file in *.txt; do echo ${file%.*} if [[ $file == *6.txt ]]; then - #statistics IPv6 /48 blocks - base=48 - else - base=32 - fi + #statistics IPv6 /48 blocks + base=48 + else + base=32 + fi cat $file | awk -F\/ '{print $2}' | (