From e131104a11915b19478cf4a46cd2a18cade05ab3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 7 Jun 2010 16:20:47 -0700 Subject: Add skip option to vyatta-interfaces Used to skip the existing interface name when doing mirror/redirect --- scripts/vyatta-interfaces.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') 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 < \$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) { -- cgit v1.2.3