diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-04-04 10:27:45 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-04-04 10:27:45 -0700 |
commit | 18b7f9a1d068b7f1261f692db30ea54955691abe (patch) | |
tree | 8691c1f7f54e6687f24c93eeb1039599f8e2f64b /scripts/vyatta-watchlink-exclude.pl | |
parent | f71417e0209a48bb88fb614acb186109e0573941 (diff) | |
parent | 41b4c40773d3fdc7dc9a204973038b1992107031 (diff) | |
download | vyatta-cfg-18b7f9a1d068b7f1261f692db30ea54955691abe.tar.gz vyatta-cfg-18b7f9a1d068b7f1261f692db30ea54955691abe.zip |
Merge branch 'glendale' into hollywood
Diffstat (limited to 'scripts/vyatta-watchlink-exclude.pl')
-rwxr-xr-x | scripts/vyatta-watchlink-exclude.pl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/vyatta-watchlink-exclude.pl b/scripts/vyatta-watchlink-exclude.pl index 048946c..eb9d280 100755 --- a/scripts/vyatta-watchlink-exclude.pl +++ b/scripts/vyatta-watchlink-exclude.pl @@ -112,6 +112,18 @@ sub remove_exclude_line { return @new_lines; } +sub is_exclude_dup { + my ($new_line, @lines) = @_; + + my $frag = substr($new_line, 0, index($new_line, ' #')); + foreach my $line (@lines) { + if (substr($line, 0, index($line, ' #')) eq $frag) { + return 1; + } + } + return 0; +} + # # main @@ -148,7 +160,9 @@ if (defined $opt_id) { } if ($opt_action eq "add") { - push @lines, $new_line; + if (! is_exclude_dup($new_line, @lines)) { + push @lines, $new_line; + } } elsif (defined $opt_intf) { @lines = remove_exclude_line($new_line, @lines); } else { |