diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-27 10:25:45 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-27 10:25:45 -0800 |
commit | 2a8e5030a85ba753234aea9ba5e4afc9d02c9ea5 (patch) | |
tree | 737b47318a20daf6cc84713029abbefb8266efa2 /scripts | |
parent | d06e7889e624285f940caa44a92d988ffe3bdf75 (diff) | |
download | vyatta-cfg-2a8e5030a85ba753234aea9ba5e4afc9d02c9ea5.tar.gz vyatta-cfg-2a8e5030a85ba753234aea9ba5e4afc9d02c9ea5.zip |
Fix --vif option
When finding allwed VIF, want to show vif id not name.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 14 |
1 files changed, 8 insertions, 6 deletions
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; |