From 0f69b4387438567276311f064803752fa006dc0e Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Wed, 13 May 2020 21:18:53 +0800 Subject: [PATCH] pretty-output: node-dir support --- scripts/pretty-output.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/pretty-output.sh b/scripts/pretty-output.sh index 0469dda..238eb25 100755 --- a/scripts/pretty-output.sh +++ b/scripts/pretty-output.sh @@ -123,7 +123,6 @@ route) subnet="${subnet/,/\/}" source "$i" case "$TYPE" in - TUN30) print_tun30 "$subnet" "$PROTO" "$UPSTREAM" "$DOWNSTREAM";; SUBNET) print_subnet "$subnet" "$NAME" "$DESC";; LO) print_lo "$subnet" "$NAME" "$DESC";; *) errmsg "Invalid \$TYPE in $i\n";; @@ -131,7 +130,21 @@ route) done ;; people);; -node);; +node) + for i in node/*; do + node="${i#node/}" + source "$i" + + echo -e \ + "${BRIGHT}${BBLUE}${FYELLOW}========================================${RESET}" + + printf "${BRIGHT}${FYELLOW}%12s${RESET} | ${BRIGHT}${FGREEN}%20s${RESET} | ${FCYAN}%s${RESET}\n" "AS${ASN}" "$node" "$DESC" + + for ip in "${IP[@]}"; do + printf "\t%s\n" "$ip" + done + done + ;; *) errmsg "Invalid type\n";; esac