From 2a8e5030a85ba753234aea9ba5e4afc9d02c9ea5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 27 Feb 2009 10:25:45 -0800 Subject: Fix --vif option When finding allwed VIF, want to show vif id not name. --- scripts/vyatta-interfaces.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 8fce903..89b6e1e 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -439,21 +439,23 @@ sub is_valid_name { sub show_interfaces { my $type = shift; my @interfaces = getInterfaces(); + my @match; foreach my $name (@interfaces) { my $intf = new Vyatta::Interface($name); - next unless $intf; + next unless $intf; # skip unknown types next unless ($type eq 'all' || $type eq $intf->type()); if ($vif_name) { - next unless ($vif_name eq $intf->physicalDevice() && $intf->vif()); + next unless $intf->vif(); + push @match, $intf->vif() + if ($vif_name eq $intf->physicalDevice()); } else { - next if $intf->vif(); + push @match, $name + unless $intf->vif(); } - print $name, ' '; } - print "\n"; - exit 0; + print join(' ', @match), "\n"; } exit 0; -- cgit v1.2.3