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:
parent
9ba6d7d631
commit
070fefabf5
|
@ -49,7 +49,8 @@ zone \"""$1""\" {\n\
|
||||||
}
|
}
|
||||||
GetAllNameservers() {
|
GetAllNameservers() {
|
||||||
sed -ne 's/^\s*'"$2"'\s\+\([0-9]*\s\)\?\s*[Ii][Nn]\s\+[Nn][Ss]\s\+\(\S\+\)/\3/p' "$3" | \
|
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() {
|
GetAllSubNameservers() {
|
||||||
Domain="$(SEDifyHostname "$1")"
|
Domain="$(SEDifyHostname "$1")"
|
||||||
|
@ -281,10 +282,13 @@ ReloadZone() {
|
||||||
systemctl reload bind9 >/dev/null
|
systemctl reload bind9 >/dev/null
|
||||||
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 1 ]; then
|
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 1 ]; then
|
||||||
for Zone in $2; do
|
for Zone in $2; do
|
||||||
rndc reload "$1" IN "$Zone" 2>"/tmp/dnsscript_rndcerr" >/dev/null || \
|
if ! rndc reload "$1" IN "$Zone" 2>"/tmp/dnsscript_rndcerr" >/dev/null; then
|
||||||
[ -n "$3" ] && grep -q "failed: out of range" "/tmp/dnsscript_rndcerr" && \
|
if [ -n "$3" ] && grep -q "failed: out of range" "/tmp/dnsscript_rndcerr"; then
|
||||||
rndc sync -clean "$1" IN "$Zone" >/dev/null || \
|
rndc sync -clean "$1" IN "$Zone" >/dev/null || touch "/tmp/dnsscript-forcereconf"
|
||||||
touch "/tmp/dnsscript-forcereconf"
|
else
|
||||||
|
touch "/tmp/dnsscript-forcereconf"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -f "/tmp/dnsscript_rndcerr"
|
rm -f "/tmp/dnsscript_rndcerr"
|
||||||
done
|
done
|
||||||
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 2 ]; then
|
elif [ $((DNSSCRIPT_BIND_RELOAD_VER)) -eq 2 ]; then
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# exit script when command fails
|
# exit script when command fails
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export DNSSCRIPT_VERSION="0.8.2"
|
export DNSSCRIPT_VERSION="0.8.3"
|
||||||
|
|
||||||
. /etc/ffdns/community.conf
|
. /etc/ffdns/community.conf
|
||||||
. /etc/ffdns/local.conf
|
. /etc/ffdns/local.conf
|
||||||
|
|
Loading…
Reference in New Issue