mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
Add IPv6 information
This commit is contained in:
parent
fd9437fa3f
commit
f55ee03877
14
bench.sh
14
bench.sh
@ -12,7 +12,6 @@ freq=$( awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo )
|
|||||||
tram=$( free -m | awk 'NR==2 {print $2}' )
|
tram=$( free -m | awk 'NR==2 {print $2}' )
|
||||||
swap=$( free -m | awk 'NR==4 {print $2}' )
|
swap=$( free -m | awk 'NR==4 {print $2}' )
|
||||||
up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime )
|
up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime )
|
||||||
ipv6=$( curl -s -6 icanhazip.com )
|
|
||||||
|
|
||||||
next() {
|
next() {
|
||||||
printf "%-70s\n" "-" | sed 's/\s/-/g'
|
printf "%-70s\n" "-" | sed 's/\s/-/g'
|
||||||
@ -94,9 +93,16 @@ next
|
|||||||
if [ -e '/usr/bin/wget' ]; then
|
if [ -e '/usr/bin/wget' ]; then
|
||||||
echo -e "Node Name\t\t\tIPv4 address\t\tDownload Speed"
|
echo -e "Node Name\t\t\tIPv4 address\t\tDownload Speed"
|
||||||
speed && next
|
speed && next
|
||||||
if [[ "$ipv6" != "" ]]; then
|
if [ -e '/usr/bin/curl' ]; then
|
||||||
echo -e "Node Name\t\t\tIPv6 address\t\tDownload Speed"
|
ipv6=$(curl -s -6 icanhazip.com)
|
||||||
speed_v6 && next
|
if [[ "$ipv6" = "" ]]; then
|
||||||
|
echo "IPv6 address not found. IPv6 speed test is ignored."
|
||||||
|
else
|
||||||
|
echo -e "Node Name\t\t\tIPv6 address\t\tDownload Speed"
|
||||||
|
speed_v6 && next
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "curl command not found. IPv6 speed test is ignored."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Error: wget command not found. You must be install wget command at first."
|
echo "Error: wget command not found. You must be install wget command at first."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user