diff --git a/dns-functions.sh b/dns-functions.sh index 10b01b6..48ad97f 100755 --- a/dns-functions.sh +++ b/dns-functions.sh @@ -155,7 +155,7 @@ ReloadZone() { for Zone in $2; do rndc reload "$1" IN "$Zone" done - else + elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 2 ]; then /etc/init.d/named reload fi } diff --git a/update-dns.sh b/update-dns.sh index f3cc597..844d72a 100755 --- a/update-dns.sh +++ b/update-dns.sh @@ -16,10 +16,13 @@ UpdateScriptsFolder="/usr/lib/ffdns/" ZoneFilesFolder="/etc/bind/fff/" BindIncludeFileFolder="/etc/bind/" -# 0 -> Debian (and like) systemctl reload bind9 -# 1 -> use rndc to reload zone (recommended; rndc needs setup first) -# 2 -> OpenWRT /etc/init.d/named reload -# +# -1 -> disable bind restarting/reloading +# 0 -> Debian (and like) systemctl [reload|restart] bind9 +# 1 -> use rndc to [reload zone|restart] (recommended; rndc needs setup first) +# 2 -> OpenWRT /etc/init.d/named [reload|restart] +# +# Set -1 for first run to prevent exiting on error and let the script generate the config and zonefiles +# after first run edit your config and set appropriate value export DNSSCRIPT_BIND_RELOAD_VER=0 # only necessary when rndc is used @@ -128,7 +131,7 @@ if [ $ReConfigBind -eq 0 ]; then systemctl restart bind9 elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 1 ]; then rndc reconfig - else + elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 2 ]; then /etc/init.d/named restart fi fi