fix: permissions; unnecessary key reload when serving extern and root; reloading with rndc

Signed-off-by: Blackyfff <freifunk@freifunk-herpf.de>
This commit is contained in:
Blackyfff 2021-07-29 22:54:18 +02:00
parent 9ba6d7d631
commit 070fefabf5
5 changed files with 10 additions and 6 deletions

14
usr/lib/ffdns/dns-functions.sh Normal file → Executable file
View File

@ -49,7 +49,8 @@ zone \"""$1""\" {\n\
}
GetAllNameservers() {
sed -ne 's/^\s*'"$2"'\s\+\([0-9]*\s\)\?\s*[Ii][Nn]\s\+[Nn][Ss]\s\+\(\S\+\)/\3/p' "$3" | \
sed -e 's/\([^.]\)$/\1\.'"$1"'\./g;s/\.$//g'
sed -e 's/\([^.]\)$/\1\.'"$1"'\./g;s/\.$//g' | \
awk '!a[$0]++'
}
GetAllSubNameservers() {
Domain="$(SEDifyHostname "$1")"
@ -281,10 +282,13 @@ ReloadZone() {
systemctl reload bind9 >/dev/null
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 1 ]; then
for Zone in $2; do
rndc reload "$1" IN "$Zone" 2>"/tmp/dnsscript_rndcerr" >/dev/null || \
[ -n "$3" ] && grep -q "failed: out of range" "/tmp/dnsscript_rndcerr" && \
rndc sync -clean "$1" IN "$Zone" >/dev/null || \
touch "/tmp/dnsscript-forcereconf"
if ! rndc reload "$1" IN "$Zone" 2>"/tmp/dnsscript_rndcerr" >/dev/null; then
if [ -n "$3" ] && grep -q "failed: out of range" "/tmp/dnsscript_rndcerr"; then
rndc sync -clean "$1" IN "$Zone" >/dev/null || touch "/tmp/dnsscript-forcereconf"
else
touch "/tmp/dnsscript-forcereconf"
fi
fi
rm -f "/tmp/dnsscript_rndcerr"
done
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 2 ]; then

2
usr/lib/ffdns/update-dns.sh Normal file → Executable file
View File

@ -8,7 +8,7 @@
# exit script when command fails
set -e
export DNSSCRIPT_VERSION="0.8.2"
export DNSSCRIPT_VERSION="0.8.3"
. /etc/ffdns/community.conf
. /etc/ffdns/local.conf

0
usr/lib/ffdns/update-hoodzone.sh Normal file → Executable file
View File

0
usr/lib/ffdns/update-public-acl.sh Normal file → Executable file
View File

0
usr/lib/ffdns/update-rdnszone.sh Normal file → Executable file
View File