#!/bin/sh
#####################################################
#Count Packages and uptime
#FlyDragon(PKkingsong) cnfreeos@163.com
#Http://www.cnfreeos.org
#OICQ:42560779
#####################################################
intfnum=`netstat -inb|grep Link#|wc -l`
up=`uptime|awk '{print "Uptime Total:"$3$4$5}'`
echo $up
echo The Macheine have $intfnum Interfaces
intfnum=`expr $intfnum + 1`
counter=1
while [ $counter -lt $intfnum ]
do
l1=`netstat -inb|grep Link#$counter|awk '{print "Interface "$1":" " Input pkg "$7/1048576"Mbytes // Out pkg "$10/1048576"Mbytes"}'`
echo $l1
counter=`expr $counter + 1`
done
exit