IP address

This commit is contained in:
Teddysun 2015-09-09 14:26:10 +08:00
parent d9c1a87415
commit f3e9d39a44

View File

@ -19,8 +19,8 @@ next() {
speed_test() { speed_test() {
speedtest=$(wget -4O /dev/null $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}') speedtest=$(wget -4O /dev/null $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}')
ipcheck=$(curl -4v -r 0-128 -o /dev/null $1 2>&1| awk -F'[()]' '/Connected/{print$2}') ipaddress=$(curl -4v -r 0-128 -o /dev/null $1 2>&1 | awk -F'[()]' '/Connected/{print$2}')
echo -e "Download speed from \e[33m$2\e[0m(IP:\e[32m$ipcheck\e[0m): \e[31m$speedtest\e[0m" echo -e "Download speed from \e[33m$2\e[0m(IP:\e[32m$ipaddress\e[0m): \e[31m$speedtest\e[0m"
} }
speed() { speed() {