include more babel and statics to acl

This commit is contained in:
Blackyfff 2021-01-23 23:37:49 +01:00
parent f9a4228a03
commit 9b57cc5587
4 changed files with 17 additions and 7 deletions

View File

@ -32,7 +32,7 @@ In der Datei update-dns.sh die Konfigurationsparameter setzen.
#### Cron anlegen
Schließlich muss noch ein Cron angelegt werden, der regelmäßig das Skript aufruft, welches die Zonendatei aktualisiert und die Reverse-Skripte aufruft:
Schließlich muss noch ein Cron angelegt werden, der regelmäßig das Skript aufruft:
```
1-59/5 * * * * /usr/lib/ffdns/update-dns.sh
```

View File

@ -117,7 +117,7 @@ for Hood in $Hoods; do
./update-extzone.sh "$HoodZoneFile" "$ExternFile" "$HoodDomain" "$ExternalView"
done
./update-public-acl.sh "$BindIcvpnAclTmp"
./update-public-acl.sh "$BindIcvpnAclTmp" "$RemoteLocation"
ReConfigBind=1
UpdateBindConfig() {

View File

@ -3,14 +3,24 @@
. ./dns-functions.sh
IncludeFile="$1"
RemoteLocation="$2"
rm -f "$IncludeFile"
InstalledRoutes="$(echo "dump" | nc ::1 33123 | \
sed -e '/\(add route .* installed yes\|add xroute\)/!d')"
PublicSubs="$(echo "$InstalledRoutes" | \
sed -e '/\( from ::\/0\| from 0\.0\.0\.0\/0\)/d;s/.* from \(\S\+\).*/\t\1;/g')"
PrivatePrefix="\(192\.168\.\|172\.\(1[6-9]\|2[0-9]\|3[01]\)\.\|10\.\|[fF][cCdD][0-9a-fA-F]\{2\}:\)"
PublicSingles="$(echo "$InstalledRoutes" | \
sed -e '/\( from ::\/0\| from 0\.0\.0\.0\/0\)/!d;s/.* prefix \(\S\+\) .*/\1/g;'" \
"'/^'"$PrivatePrefix"'/d;/^\(0\.\|::\|64:ff9b::\)/d;s/^/\t/g;s/$/;/g')"
{
echo "acl icvpnrange {"
echo " icvpnlocal;"
echo "dump" | nc ::1 33123 | \
sed -e '/add route/!d;/installed yes/!d;/\(from ::\/0\|from 0\.0\.0\.0\/0\)/d;' | \
sed -ne 's/^.*from \(\S\+\).*/\t\1;/p'
echo "$PublicSubs"
echo "$(curl -s -S -f "$RemoteLocation""external.dnsserverips" | sed -e 's/^/\t/g;s/$/;/g')"
echo "$PublicSingles"
echo "};"
} > "$IncludeFile"
} > "$IncludeFile"

View File

@ -54,7 +54,7 @@ if [ $((NewReverseSerial)) -gt $((OldSerial)) ]; then
Static="/""$ReverseZoneFile"
Static="${Static%/*}""/static.""${Static##*/}"
Static="${Static#*/}"
[ -f "$Static" ] && cat "$Static"
[ -f "$Static" ] && echo "$(cat "$Static")"
echo
} > "$TempDir/$ReverseZone"