From a2fb5922a42737e3b6a23df9dca5903cfac11881 Mon Sep 17 00:00:00 2001 From: Chris Gahan Date: Mon, 20 Jul 2015 13:00:21 -0400 Subject: [PATCH] 'bhogs' wrapper which automatically adds connected network devices to 'nethogs' argments --- bhogs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bhogs diff --git a/bhogs b/bhogs new file mode 100755 index 00000000..e59b349a --- /dev/null +++ b/bhogs @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby + +devs = open("/proc/net/dev").each_line.map do |line| + if line =~ /^\s*([ewa][^:]+): / + $1 + end +end.compact + +system("sudoifnotroot", "nethogs", *devs) \ No newline at end of file