2021-01-04 20:53:39 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./dns-functions.sh
|
|
|
|
|
|
|
|
InternalZoneFile="$1"
|
|
|
|
ExternalZoneFile="$2"
|
|
|
|
ExternalZone="$3"
|
|
|
|
ExternalView="$4"
|
|
|
|
|
|
|
|
SerialIntern="$(GetZoneFileSerial "$InternalZoneFile")"
|
2021-01-19 17:49:06 +01:00
|
|
|
SerialExtern="$(GetZoneFileSerial "$ExternalZoneFile")"
|
2021-01-04 20:53:39 +01:00
|
|
|
|
2021-01-19 17:49:06 +01:00
|
|
|
if [ $((SerialIntern)) -gt $((SerialExtern)) ]; then
|
2021-01-14 20:46:10 +01:00
|
|
|
sed '/^[^;]*\s\(10.\|[fF][cdCD][0-9a-fA-F]\{2\}:\)\S*\s*\(;.*\)\?$/d' "$InternalZoneFile" > "$ExternalZoneFile"
|
2021-01-04 20:53:39 +01:00
|
|
|
ReloadZone "$ExternalZone" "$ExternalView"
|
|
|
|
fi
|