function addConfigLine($line, $lineno=0)
{
+ $line_n = trim($line);
+ $line = $line_n;
$expl = preg_split("/ +/", $line);
+ if(count($expl) < 2) {
+ $c = count($expl);
+ error_log("Not a valid config line ($c), $line");
+ return 0;
+ }
echo "process command ".$expl[0]."\n";
// find a description
}
}
- // now rebuild the array if there was one
+ // now rebuild the array if there was a description
if($hasdescription) {
for($i=0; $i<$hasdescription; $i++) {
$expl_r[$i] = $expl[$i];
unset($expl[count($expl)-1]);
}
+ // now for modify
+ $modify = false;
+ // check for delete on the line
+ if($expl[0] == "modify") {
+ $modify = true;
+
+ // re-order the array
+ for($i=0; $i < (count($expl)-1); $i++) {
+ $expl[$i] = $expl[$i+1];
+ }
+ unset($expl[count($expl)-1]);
+ }
+
switch($expl[0]) {
case "hostname":
// set the hostname to $1