diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/services.inc | 10 | ||||
-rw-r--r-- | etc/inc/system.inc | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index cea79fe..b3ef24e 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -560,6 +560,8 @@ EOD; function services_dnsmasq_configure() { global $config, $g; + $return = 0; + if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_dnsmasq_configure() being called $mt\n"; @@ -576,7 +578,8 @@ function services_dnsmasq_configure() { sleep(1); /* generate hosts file */ - system_hosts_generate(); + if(system_hosts_generate()!=0) + $return = 1; $args = ""; @@ -600,10 +603,11 @@ function services_dnsmasq_configure() { } if (!$g['booting']) { - services_dhcpd_configure(); + if(services_dhcpd_configure()!=0) + $return = 1; } - return 0; + return $return; } function services_snmpd_configure() { diff --git a/etc/inc/system.inc b/etc/inc/system.inc index bd5c2fa..eadb100 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -185,6 +185,13 @@ EOD; else $hosts .= "{$host['ip']} {$host['domain']}\n"; } + if (isset($dnsmasqcfg['regdhcpstatic'])) { + foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) + if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable'])) + foreach ($dhcpifconf['staticmap'] as $host) + if ($host['ipaddr'] && $host['hostname']) + $hosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n"; + } fwrite($fd, $hosts); fclose($fd); |