summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-27 10:25:45 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-27 10:25:45 -0800
commit2a8e5030a85ba753234aea9ba5e4afc9d02c9ea5 (patch)
tree737b47318a20daf6cc84713029abbefb8266efa2 /scripts
parentd06e7889e624285f940caa44a92d988ffe3bdf75 (diff)
downloadvyatta-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-xscripts/vyatta-interfaces.pl14
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;