solana/scripts/iftop.sh
Pankaj Garg 2e30926ac3
New program to process iftop log output (#6668)
* New program to process iftop log output

* fixes

* fix shellcheck

* address review comments

* more review comments
2019-10-31 18:22:57 -07:00

17 lines
296 B
Bash
Executable File

#!/usr/bin/env bash
#
# Reports network bandwidth usage
#
set -e
[[ $(uname) == Linux ]] || exit 0
cd "$(dirname "$0")"
sudo=
if sudo true; then
sudo="sudo -n"
fi
$sudo iftop -i "$(ifconfig | grep mtu | grep -iv loopback | grep -i running | awk 'BEGIN { FS = ":" } ; {print $1}')" -nNbBP -t