17 lines
440 B
Bash
Executable File
17 lines
440 B
Bash
Executable File
#!/bin/sh
|
|
|
|
. ./dns-functions.sh
|
|
|
|
InternalZoneFile="$1"
|
|
ExternalZoneFile="$2"
|
|
ExternalZone="$3"
|
|
ExternalView="$4"
|
|
|
|
SerialIntern="$(GetZoneFileSerial "$InternalZoneFile")"
|
|
SerialExtern="$(GetZoneFileSerial "$ExternalZoneFile")"
|
|
|
|
if [ $((SerialIntern)) -gt $((SerialExtern)) ]; then
|
|
sed '/^[^;]*\s\(10.\|[fF][cdCD][0-9a-fA-F]\{2\}:\)\S*\s*\(;.*\)\?$/d' "$InternalZoneFile" > "$ExternalZoneFile"
|
|
ReloadZone "$ExternalZone" "$ExternalView"
|
|
fi
|