diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-06-07 16:20:47 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-06-07 16:27:40 -0700 |
commit | e131104a11915b19478cf4a46cd2a18cade05ab3 (patch) | |
tree | 854c631cc6713984ad9f4c08c2f343dae1cb7690 /scripts/vyatta-interfaces.pl | |
parent | fa7d9a1c503bb53b2512c56030d4778f641cd2dc (diff) | |
download | vyatta-cfg-system-e131104a11915b19478cf4a46cd2a18cade05ab3.tar.gz vyatta-cfg-system-e131104a11915b19478cf4a46cd2a18cade05ab3.zip |
Add skip option to vyatta-interfaces
Used to skip the existing interface name when doing mirror/redirect
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 42ffc7d8..d5abaa36 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -47,10 +47,11 @@ use warnings; my $dhcp_daemon = '/sbin/dhclient'; -my ($eth_update, $eth_delete, $addr_set, @addr_commit, $dev, $mac, $mac_update); +my ($eth_update, $eth_delete, $addr_set, $dev, $mac, $mac_update); +my %skip_interface; my ($check_name, $show_names, $intf_cli_path, $vif_name, $warn_name); my ($check_up, $show_path, $dhcp_command); -my @speed_duplex; +my (@speed_duplex, @addr_commit); sub usage { print <<EOF; @@ -80,6 +81,7 @@ GetOptions("eth-addr-update=s" => \$eth_update, "dhcp=s" => \$dhcp_command, "check=s" => \$check_name, "show=s" => \$show_names, + "skip=s" => sub { $skip_interface{$_[1]} = 1 }, "vif=s" => \$vif_name, "warn" => \$warn_name, "path" => \$show_path, @@ -523,6 +525,7 @@ sub show_interfaces { foreach my $name (@interfaces) { my $intf = new Vyatta::Interface($name); next unless $intf; # skip unknown types + next if $skip_interface{$name}; next unless ($type eq 'all' || $type eq $intf->type()); if ($vif_name) { |