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:
parent
3d8bc4980b
commit
a920f94804
7
xCAT-server/lib/xcat/plugins/ddns.pm
Executable file → Normal file
7
xCAT-server/lib/xcat/plugins/ddns.pm
Executable file → Normal 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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user