diff options
-rw-r--r-- | etc/inc/services.inc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 5f6187f..6076ec9 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1411,6 +1411,41 @@ function services_dnsmasq_configure() { return $return; } +function services_unbound_configure() { + global $config, $g; + $return = 0; + + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_unbound_configure() being called $mt\n"; + } + + /* kill any running unbound */ + sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM"); + + if (isset($config['unbound']['enable'])) { + + if ($g['booting']) + echo "Starting Unbound DNS..."; + else + sleep(1); + + /* generate Unbound config file */ + if(unbound_generate_config()!=0) { + log_error("Problem generating Unbound configuration."); + $return = 1; + } + + /* run Unbound */ + mwexec("/usr/local/sbin/unbound"); + + if ($g['booting']) + echo "done.\n"; + } + + return $return; +} + function services_snmpd_configure() { global $config, $g; if(isset($config['system']['developerspew'])) { |