Zone-Serial-Parsing auch bei vorangestellter TTL
This commit is contained in:
parent
336e5ea0fa
commit
35ce035d87
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue