From fff95f03b7749dc76468c008d4ecc079d9700b06 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Wed, 6 Nov 2013 23:56:16 -0200 Subject: bind - fix bind service starting while disabled on gui --- config/bind/bind.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'config/bind') diff --git a/config/bind/bind.inc b/config/bind/bind.inc index 3b108c82..a288dcfb 100644 --- a/config/bind/bind.inc +++ b/config/bind/bind.inc @@ -429,7 +429,7 @@ EOD; $hostname = (preg_match("/(MX|NS)/",$zone['row'][$y]['hosttype'])?"@":$zone['row'][$y]['hostname']); $hosttype = $zone['row'][$y]['hosttype']; $hostdst = $zone['row'][$y]['hostdst']; - if (preg_match("/[a-zA-Z]/",$hostdst) && !preg_match("/(TXT|SPF))/",$hosttype)) + if (preg_match("/[a-zA-Z]/",$hostdst) && !preg_match("/(TXT|SPF)/",$hosttype)) $hostdst .= "."; $hostvalue = $zone['row'][$y]['hostvalue']; @@ -578,10 +578,15 @@ EOD; chown(CHROOT_LOCALBASE."/var/log","bind"); chown(CHROOT_LOCALBASE."/var/run/named","bind"); chgrp(CHROOT_LOCALBASE."/var/log","bind"); - if($bind_enable == "on") - mwexec("/usr/local/etc/rc.d/named.sh restart"); - else - mwexec("/usr/local/etc/rc.d/named.sh stop"); + $bind_sh="/usr/local/etc/rc.d/named.sh"; + if($bind_enable == "on"){ + chmod ($bind_sh,0755); + mwexec("{$bind_sh} restart"); + } + elseif (is_service_running('named')){ + mwexec("{$bind_sh} stop"); + chmod ($bind_sh,0644); + } //sync to backup servers bind_sync_on_changes(); conf_mount_ro(); -- cgit v1.2.3