summaryrefslogtreecommitdiff
path: root/scripts/vyatta-watchlink-exclude.pl
diff options
context:
space:
mode:
authorrbalocca <rbalocca@vyatta.com>2008-04-04 10:27:45 -0700
committerrbalocca <rbalocca@vyatta.com>2008-04-04 10:27:45 -0700
commit18b7f9a1d068b7f1261f692db30ea54955691abe (patch)
tree8691c1f7f54e6687f24c93eeb1039599f8e2f64b /scripts/vyatta-watchlink-exclude.pl
parentf71417e0209a48bb88fb614acb186109e0573941 (diff)
parent41b4c40773d3fdc7dc9a204973038b1992107031 (diff)
downloadvyatta-cfg-18b7f9a1d068b7f1261f692db30ea54955691abe.tar.gz
vyatta-cfg-18b7f9a1d068b7f1261f692db30ea54955691abe.zip
Merge branch 'glendale' into hollywood
Diffstat (limited to 'scripts/vyatta-watchlink-exclude.pl')
-rwxr-xr-xscripts/vyatta-watchlink-exclude.pl16
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 {