mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-28 01:45:33 +00:00 
			
		
		
		
	check if the include line is already there before adding it to the file
This commit is contained in:
		
							
								
								
									
										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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user