diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-02 19:29:50 +0000 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-02 19:35:20 +0000 |
commit | d533602d8f2114337bd5620dd05e3205784547db (patch) | |
tree | c91abda5a0645fa18057b71bde356acb7a9e9c41 | |
parent | 529c855c33ca97051dc3f5e0ec58d936238d820f (diff) | |
download | vyatta-op-d533602d8f2114337bd5620dd05e3205784547db.tar.gz vyatta-op-d533602d8f2114337bd5620dd05e3205784547db.zip |
vyatta-op: skip unknown interfaces in "show interfaces counters/detail"
Skip unknown interface types when running "show interfaces counters" or
"show interfaces detail" from the CLI.
Bug #610 http://bugzilla.vyos.net/show_bug.cgi?id=610
-rwxr-xr-x | scripts/vyatta-show-interfaces.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index 871e44d..034a936 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -218,6 +218,9 @@ sub run_show_intf { my @intfs = @_; foreach my $intf (@intfs) { + my $interface = new Vyatta::Interface($intf); + next unless $interface; + my %clear = get_clear_stats($intf); my $description = get_intf_description($intf); my $timestamp = $clear{'timestamp'}; @@ -355,6 +358,9 @@ sub run_show_counters { printf("%-12s %10s %10s %10s %10s\n","Interface","Rx Packets","Rx Bytes","Tx Packets","Tx Bytes"); foreach my $intf (@intfs) { + my $interface = new Vyatta::Interface($intf); + next unless $interface; + my ($state, $link) = get_state_link($intf); next if $state ne 'up'; my %clear = get_clear_stats($intf); |