From 7cf3e98090a3e9f0a9cc960d07c5f259adab6a19 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 08:39:08 -0500
Subject: [PATCH] Merge remote-tracking branch 'origin/stable-3.0.5'

---
 server/mods-available/dns_module.inc.php |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/server/mods-available/dns_module.inc.php b/server/mods-available/dns_module.inc.php
index 2a06361..9bab96e 100644
--- a/server/mods-available/dns_module.inc.php
+++ b/server/mods-available/dns_module.inc.php
@@ -121,6 +121,8 @@
 	function restartBind($action = 'restart') {
 		global $app,$conf;
 		
+		$app->uses('system');
+		
 		$daemon = '';
 		if(is_file($conf['init_scripts'] . '/' . 'bind9')) {
 			$daemon = 'bind9';
@@ -130,9 +132,9 @@
 		
 		$retval = array('output' => '', 'retval' => 0);
 		if($action == 'restart') {
-			exec($conf['init_scripts'] . '/' . $daemon . ' restart 2>&1', $retval['output'], $retval['retval']);
+			exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
 		} else {
-			exec($conf['init_scripts'] . '/' . $daemon . ' reload 2>&1', $retval['output'], $retval['retval']);
+			exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
 		}
 		return $retval;
 	}
@@ -140,6 +142,7 @@
 	function restartPowerDNS($action = 'restart') {
 		global $app,$conf;
 	
+		$app->uses('system');
 		$app->log("restartPDNS called.",LOGLEVEL_DEBUG);
 
 /**     Since PowerDNS does not currently allow to limit AXFR for specific zones to specific
@@ -179,7 +182,7 @@
 		}
 
 		$retval = array('output' => '', 'retval' => 0);
-		exec($conf['init_scripts'] . '/' . $daemon . ' restart 2>&1', $retval['output'], $retval['retval']);
+		exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
 
 //     unset $tmps;
 		return $retval;

--
Gitblit v1.9.1