Add color for diagnose script

This commit is contained in:
KAAAsS 2021-04-15 21:58:06 +08:00
parent 03e011765b
commit de41d350cf
Signed by: KAAAsS
GPG Key ID: D56625F3E671882F

View File

@ -1,17 +1,28 @@
#!/bin/bash
set -e
echo "Protocols Status: "
GREEN='0;32'
__color() {
c=$1
shift 1
printf "\033[${c}m$@\033[0m"
}
echo
__color $GREEN "Protocols Status: "
echo
/usr/bin/birdc show protocols
echo "Route to DN42 anycast dns: "
echo
__color $GREEN "Route to DN42 anycast dns: "
echo
/usr/bin/birdc show route for 172.20.0.53 all
echo "Ping DN42 anycast dns: "
echo
__color $GREEN "Ping DN42 anycast dns: "
echo
ping -c 4 172.20.0.53