Project

General

Profile

« Previous | Next » 

Revision a2578c27

Added by Anthony Wrather over 13 years ago

Updated DHCP IPv4 and IPv6 to allow global and host based filename and root-path.

View differences:

etc/inc/services.inc
516 516

  
517 517
		// net boot information
518 518
		if(isset($dhcpifconf['netboot'])) {
519
			if (($dhcpifconf['next-server'] <> "") && ($dhcpifconf['filename'] <> "")) {
520
				$dhcpdconf .= "	next-server {$dhcpifconf['next-server']};\n";
519
			if ($dhcpifconf['nextserver'] <> "") {
520
				$dhcpdconf .= "	next-server {$dhcpifconf['nextserver']};\n";
521
			}
522
			if ($dhcpifconf['filename'] <> "") {
521 523
				$dhcpdconf .= "	filename \"{$dhcpifconf['filename']}\";\n";
522 524
			}
523 525
			if ($dhcpifconf['rootpath'] <> "") {
......
548 550
					$dhhostname = str_replace(".", "_", $dhhostname);
549 551
					$dhcpdconf .= "	option host-name \"{$dhhostname}\";\n";
550 552
				}
551
				if ($sm['netbootfile'])
552
					$dhcpdconf .= "	filename \"{$sm['netbootfile']}\";\n";
553
				if ($sm['filename'])
554
					$dhcpdconf .= "	filename \"{$sm['filename']}\";\n";
555

  
556
				if ($sm['rootpath'])
557
					$dhcpdconf .= "	option root-path \"{$sm['rootpath']}\";\n";
553 558

  
554 559
				$dhcpdconf .= "}\n";
555 560
				$i++;
......
851 856

  
852 857
		// net boot information
853 858
		if(isset($dhcpv6ifconf['netboot'])) {
854
			if (($dhcpv6ifconf['next-server'] <> "") && ($dhcpv6ifconf['filename'] <> "")) {
855
				$dhcpdv6conf .= "	next-server {$dhcpv6ifconf['next-server']};\n";
859
			if ($dhcpv6ifconf['nextserver'] <> "") {
860
				$dhcpdv6conf .= "	next-server {$dhcpv6ifconf['nextserver']};\n";
861
			}
862
			if ($dhcpv6ifconf['filename'] <> "") {
856 863
				$dhcpdv6conf .= "	filename \"{$dhcpv6ifconf['filename']}\";\n";
857 864
			}
858 865
			if ($dhcpv6ifconf['rootpath'] <> "") {
......
862 869
		
863 870
		$dhcpdv6conf .= <<<EOD
864 871
}
872

  
865 873
EOD;
866 874

  
867 875
		/* add static mappings */
......
883 891
					$dhhostname = str_replace(".", "_", $dhhostname);
884 892
					$dhcpdv6conf .= "	option host-name {$dhhostname};\n";
885 893
				}
886
				if ($sm['netbootfile'])
887
					$dhcpdv6conf .= "	filename \"{$sm['netbootfile']}\";\n";
894
				if ($sm['filename'])
895
					$dhcpdv6conf .= "	filename \"{$sm['filename']}\";\n";
896

  
897
				if ($sm['rootpath'])
898
					$dhcpdv6conf .= "	option root-path \"{$sm['rootpath']}\";\n";
888 899

  
889 900
				$dhcpdv6conf .= "}\n";
890 901
				$i++;

Also available in: Unified diff