From 9014f80e5ed034899f8eceb6e16838df4ac50ece Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 5 Aug 2013 23:36:12 -0400 Subject: [PATCH] Add enable variable for DNS server in network-parameters --- stage2/install-bootscripts | 3 +++ stage3/bootscripts/named | 10 +++++++++- stage3/pkg/bind | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) 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 } -- 2.20.1