#!/bin/sh
LANG=""
while true
do
up_time1=`ifconfig $1 | grep "bytes" | awk '{print $6}'|awk -F: '{print $2}'`
down_time1=`ifconfig $1 | grep "bytes" | awk '{print $2}'|awk -F: '{print $2}'`
sleep 1
clear
up_time2=`ifconfig $1 | grep "bytes" | awk '{print $6}'|awk -F: '{print $2}'`
down_time2=`ifconfig $1 | grep "bytes" | awk '{print $2}'|awk -F: '{print $2}'`
up_time1=${up_time1}
up_time2=${up_time2}
down_time1=${down_time1}
down_time2=${down_time2}
up_time=`expr $up_time2 - $up_time1`
down_time=`expr $down_time2 - $down_time1`
up_time=`expr $up_time / 1024`
down_time=`expr $down_time / 1024`
echo 上传速度: $up_time kb/s
echo 下载速度: $down_time kb/s
done
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)