2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

check if the include line is already there before adding it to the file

This commit is contained in:
Kilian Cavalotti 2017-12-18 11:54:30 -08:00
parent 3d8bc4980b
commit a920f94804

7
xCAT-server/lib/xcat/plugins/ddns.pm Executable file → Normal file
View File

@ -1287,10 +1287,13 @@ sub update_namedconf {
my @includes = split /[ ,]/, $site_entry;
foreach (@includes) {
if (defined($_)) {
push @newnamed, "include \"$_\";\n";
my $line = "include \"$_\";\n";
unless (grep{/$line/} @newnamed) {
push @newnamed, "include \"$_\";\n";
}
}
}
push @newnamed, "\n";
}
}
unless ($slave) {