summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2012-02-03 22:23:02 +0200
committerWarren Baker <warren@decoy.co.za>2012-02-03 22:23:02 +0200
commit8ff4e4d4fbab50d1456f03d8c872dc225d69f883 (patch)
tree1c365645fe4f5cf83bfa60b14764101e405d18aa /etc
parent317b7e43bfeebd145af6f6db563dbf798cce3fbb (diff)
downloadpfsense-8ff4e4d4fbab50d1456f03d8c872dc225d69f883.zip
pfsense-8ff4e4d4fbab50d1456f03d8c872dc225d69f883.tar.gz
Support for configuring the configuring Unbound service
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/services.inc35
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'])) {
OpenPOWER on IntegriCloud