From d533602d8f2114337bd5620dd05e3205784547db Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Mon, 2 Nov 2015 19:29:50 +0000 Subject: 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 --- scripts/vyatta-show-interfaces.pl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') 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); -- cgit v1.2.3