summaryrefslogtreecommitdiff
path: root/scripts/vyatta-interfaces.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-26 12:50:58 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-26 12:50:58 -0800
commit54eed88ccb65e52ff9aea8c7386c3ca4e1918762 (patch)
tree651584d1ba6ea7e363ec1ebf141d3b3ff20f1d53 /scripts/vyatta-interfaces.pl
parent351fe2d89bf5d125cb46334c3e7629e7fc1cbc1d (diff)
downloadvyatta-cfg-54eed88ccb65e52ff9aea8c7386c3ca4e1918762.tar.gz
vyatta-cfg-54eed88ccb65e52ff9aea8c7386c3ca4e1918762.zip
Add option to show VIF for interface
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-xscripts/vyatta-interfaces.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index 9596632..5f3c5a9 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -46,7 +46,7 @@ use warnings;
my $dhcp_daemon = '/sbin/dhclient';
my ($eth_update, $eth_delete, $addr, $dev, $mac, $mac_update, $op_dhclient);
-my ($check_name, $show_names, $intf_cli_path);
+my ($check_name, $show_names, $intf_cli_path, $vif_name);
GetOptions("eth-addr-update=s" => \$eth_update,
"eth-addr-delete=s" => \$eth_delete,
@@ -57,6 +57,7 @@ GetOptions("eth-addr-update=s" => \$eth_update,
"op-command=s" => \$op_dhclient,
"check=s" => \$check_name,
"show=s" => \$show_names,
+ "vif=s" => \$vif_name,
);
if ($eth_update) { update_eth_addrs($eth_update, $dev); }
@@ -453,8 +454,13 @@ sub show_interfaces {
foreach my $name (@interfaces) {
my $intf = new Vyatta::Interface($name);
next unless $intf;
-
next unless ($type eq 'all' || $type eq $intf->type());
+
+ if ($vif_name) {
+ next unless ($vif_name eq $intf->physicalDevice() && $intf->vif());
+ } else {
+ next if $intf->vif();
+ }
print $name, ' ';
}
print "\n";