summaryrefslogtreecommitdiffstats
path: root/ethtool-cmd.py
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2008-07-02 13:28:57 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2008-07-02 13:28:57 -0300
commitc146a164a3f3a9a108d85adf8897f573c94d720e (patch)
tree203f7496baf1541a2006022d18de1944fbb8ac87 /ethtool-cmd.py
parent13ec0f5d8f226a8c3acf4c61a916ffcb7ecf0cac (diff)
downloadpython-ethtool-c146a164a3f3a9a108d85adf8897f573c94d720e.tar.gz
python-ethtool-c146a164a3f3a9a108d85adf8897f573c94d720e.tar.xz
python-ethtool-c146a164a3f3a9a108d85adf8897f573c94d720e.zip
pethtool: show if a device is active or not
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'ethtool-cmd.py')
-rwxr-xr-xethtool-cmd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ethtool-cmd.py b/ethtool-cmd.py
index 421e066..e828bce 100755
--- a/ethtool-cmd.py
+++ b/ethtool-cmd.py
@@ -79,10 +79,15 @@ def show_driver(interface, args = None):
def run_cmd(cmd, interface, args):
global tab
+
+ active_devices = ethtool.get_active_devices()
if not interface:
tab = " "
for interface in ethtool.get_devices():
- print "%s:" % interface
+ inactive = " (not active)"
+ if interface in active_devices:
+ inactive = ""
+ print "%s%s:" % (interface, inactive)
cmd(interface, args)
else:
cmd(interface, args)