Zone-Serial-Parsing auch bei vorangestellter TTL

This commit is contained in:
Blackyfff 2021-01-04 20:53:39 +01:00
parent 336e5ea0fa
commit 35ce035d87
1 changed files with 3 additions and 2 deletions

View File

@ -16,10 +16,11 @@ ReverseServerName=aquarius.gw.fff.community.
#################################################################
function GetZoneFileSerial() {
local FirstSOALineAndFollowing="^/\S\+\s\+IN\s\+SOA\s/,\$!d;"
local INSOAPrefix="^\s*\S\+\s\+\([0-9]*\s\)\?\s*IN\s\+SOA\s\+"
local FirstSOALineAndFollowing="/""$INSOAPrefix""/,\$!d;"
local RemoveComments=":a;s/;.*$//g;"
local RemoveLineBreaks=":a;N;\$!ba;s/\n//g;"
local SearchPrintSerial="s/^\S\+\s\+IN\s\+SOA\s\+\S\+\s\+\S\+\s\+(\?\s\+\([0-9]*\).*/\1/"
local SearchPrintSerial="s/""$INSOAPrefix""\S\+\s\+\S\+\s\+\((\s\)\?\s*\([0-9]*\).*/\3/i"
local Serial=$(sed -e "$FirstSOALineAndFollowing""$RemoveComments""$RemoveLineBreaks""$SearchPrintSerial" "$1")
echo "$Serial"