#!/bin/sh
#
# A simple script using nvstat to show the current traffic of the network.
# You must specify an interface by adding the interface after the script,
# like this: traffic eth1
#
# irssi alias: /alias traffic exec - -out ~/bin/traffic eth0

bandwidthstring=$(vnstat -tr -i $1 | grep -e rx -e tx | cut -d ' ' -f15-22 | tr "\n" " ")

echo Downstream: ${bandwidthstring:0:12} Upstream: ${bandwidthstring:12:19}
