From: Hugo Villeneuve Date: Tue, 6 Aug 2013 03:36:12 +0000 (-0400) Subject: Add enable variable for DNS server in network-parameters X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=9014f80e5ed034899f8eceb6e16838df4ac50ece;p=hvlinux.git Add enable variable for DNS server in network-parameters --- diff --git a/stage2/install-bootscripts b/stage2/install-bootscripts index c3a2edd..54d58e7 100755 --- a/stage2/install-bootscripts +++ b/stage2/install-bootscripts @@ -65,6 +65,9 @@ NFS_SERVER_ENA="no" # Set to "yes" to enable the SSH server: SSH_SERVER_ENA="no" +# Set to "yes" to enable the DNS server: +DNS_SERVER_ENA="no" + # Set FIREWALL_ENA to "yes" to enable the firewall: FIREWALL_ENA="no" # Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet): diff --git a/stage3/bootscripts/named b/stage3/bootscripts/named index 553e3ba..6092d3f 100755 --- a/stage3/bootscripts/named +++ b/stage3/bootscripts/named @@ -3,10 +3,18 @@ # Source functions library source /etc/rc.d/init.d/functions +log_script_name "$0 $*" + # Source the network parameters file for the domain name source /etc/sysconfig/network/network-parameters -log_script_name "$0 $*" +# Check if NFS server functionality is desired +if ["x${DNS_SERVER_ENA}" != "xyes" -a \ + "x${DNS_SERVER_ENA}" != "xYes" -a \ + "x${DNS_SERVER_ENA}" != "xYES" ]; then + msg_log "DNS server disabled in '/etc/sysconfig/network/network-parameters'" + exit ${EXIT_CODE_SUCCESS} +fi DAEMON=/usr/sbin/named DAEMON_DESC="BIND server" diff --git a/stage3/pkg/bind b/stage3/pkg/bind index 0b4db36..2861623 100644 --- a/stage3/pkg/bind +++ b/stage3/pkg/bind @@ -145,4 +145,7 @@ EOF # script-name start stop bootscript_add_rc3 named 25 65 + + sed -i -e "s/^\(DNS_SERVER_ENA=\).*/\1\"yes\"/" \ + etc/sysconfig/network/network-parameters }