From 7dbea06e158c10fc59962ba2b988ca0976d5c000 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 30 Oct 2009 10:17:30 -0400
Subject: [PATCH] Implemented: FS#868 - Add support for BIND 

---
 server/mods-available/dns_module.inc.php |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/server/mods-available/dns_module.inc.php b/server/mods-available/dns_module.inc.php
index 79b0e5b..72ae1df 100644
--- a/server/mods-available/dns_module.inc.php
+++ b/server/mods-available/dns_module.inc.php
@@ -75,6 +75,10 @@
 		$app->modules->registerTableHook('dns_soa',$this->module_name,'process');
 		$app->modules->registerTableHook('dns_rr',$this->module_name,'process');
 		
+		
+		// Register service
+		$app->services->registerService('bind','dns_module','restartBind');
+		
 	}
 	
 	/*
@@ -99,6 +103,25 @@
 		} // end switch
 	} // end function
 	
+	
+	function restartBind($action = 'restart') {
+		global $app;
+		
+		$command = '';
+		if(is_file('/etc/init.d/bind9')) {
+			$command = '/etc/init.d/bind9';
+		} else {
+			$command = '/etc/init.d/named';
+		}
+		
+		if($action == 'restart') {
+			exec($command.' restart');
+		} else {
+			exec($command.' reload');
+		}
+		
+	}
+	
 
 } // end class
 

--
Gitblit v1.9.1