mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
Merge pull request #4552 from stanford-rc/named_includes
Check if the include line is already there before adding it to the file
This commit is contained in:
commit
b3e235583f
7
xCAT-server/lib/xcat/plugins/ddns.pm
Executable file → Normal file
7
xCAT-server/lib/xcat/plugins/ddns.pm
Executable file → Normal file
@ -1281,10 +1281,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