#! /bin/bash
. ~/.bash_profile
#Author: Vogts WangTao 2008-12-18
#Get summry info
host2=` /sbin/ifconfig eth0 | grep inet | awk -F ':' '{print $2}' | awk '{print $1}'`
echo "Current Ip: "`/sbin/ifconfig eth0 | grep inet`
echo "Summry info: "`/sbin/ifconfig eth0 | grep bytes`
#sleep 1 second ,monitor eth0
receive1=`cat /proc/net/dev|grep eth0 | awk '{print $1}'|sed -s 's/eth0://g'`
receive_pack1=`cat /proc/net/dev|grep eth0 | awk '{print $2}'`
send1=`cat /proc/net/dev|grep eth0 | awk '{print $9}'`
send_pack1=`cat /proc/net/dev|grep eth0 | awk '{print $10}'`
sleep 1
receive2=`cat /proc/net/dev|grep eth0 | awk '{print $1}'|sed -s 's/eth0://g'`
receive_pack2=`cat /proc/net/dev|grep eth0 | awk '{print $2}'`
receive_cnt=`expr $receive2 - $receive1`