Welcome to mirror list, hosted at ThFree Co, Russian Federation.

generate_netstats.sh « unix « tools - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cb9c09a7a93471e86835b2aada444aee8bf0ed17 (plain)
1
2
3
4
5
6
7
#!/bin/bash

RX_BYTES=`ifconfig eth0 | grep -o 'RX bytes:[0-9]*' | grep -o '[0-9]*'`
TX_BYTES=`ifconfig eth0 | grep -o 'TX bytes:[0-9]*' | grep -o '[0-9]*'`
ACTIVE_DOWNLOADS=`netstat -n | grep 'tcp.*:80 .*ESTABLISHED' | wc -l`

echo $ACTIVE_DOWNLOADS $RX_BYTES $TX_BYTES $(($RX_BYTES + $TX_BYTES))