출처 :http://ttongfly.net

#!/bin/sh
#
# Scripted by JoungKyun Kim
# 2001.2.15 http://www.oops.org
# This Script follows GPL2 License

if [ "$1" != "" ]; then
# ethnet device
ETH="$1:"
CHECK=/proc/net/dev
CAT=/bin/cat

GREP="/bin/grep ${ETH}"
SED="sed -e s/${ETH}//"
UPTIME=/usr/bin/uptime

# parcket user check
set `${CAT} ${CHECK} | ${GREP} | ${SED}`

# Transmit packet
let "in1 = $1"
let "out1 = $9"

echo "측정중입니다. 기다려주세요"
sleep 10

set `${CAT} ${CHECK} | ${GREP} | ${SED}`

let "in0 = $1"
let "out0 = $9"

let " in = ($in0 - $in1)/(10*1024)"
let " out = ($out0 - $out1)/(10*1024)"
echo "수신(in) $in kbyte/s"
echo "송신(out) $out kbyte/s"


else
echo "USAGE: $0 [ethernet device no]"
echo "ex) ./$0 eth0"
fi

exit 0
Posted by [czar]
,