} } // ok, now grab the stragler static hosts $configdata .= "\n#### Static Hosts w/o PXE Group Membership ####\n"; foreach ($results['static_hosts'] as $key => $value) { if (empty($value['pxe-group'])) { $configdata .= "host " . $value['hostname'] . " {\n"; $configdata .= "\thardware ethernet " . $value['mac-address'] . ";\n"; $configdata .= "\tfixed-address " . $value['ip-address'] . ";\n"; $configdata .= "}\n"; } } $configdata_html = preg_replace('/\\n/', "<br>", preg_replace('/\\t/', " ", $configdata)); } // perform a quick temp file write to test configuration on if (($return = $misc->SafeWriteFile($defined['confpath'], 'dhcpd.test', $configdata)) == 0) { // create test command to ensure file validity $cmd = escapeshellcmd($defined['dhcpd_tst']); $handle = popen($cmd . " 2>&1", "r"); while ($read = fread($handle, 2096)) { // look for errors in output if (eregi('^error|^warning|^bad|expecting', $read)) { $list = "<li>" . $read . "</li>"; $wtf = 1; } } } if ($wtf === 1) { $error = $err->GenerateErrorLink("help/help.html", "#build_config", $defined['error'], "An error was found when testing syntax.<br><br><ol>" . $list . "</ol>", NULL, NULL); $disable = "disabled"; }