diff --git a/10-50-reverse.sh b/10-50-reverse.sh index e442781..d5122c3 100755 --- a/10-50-reverse.sh +++ b/10-50-reverse.sh @@ -16,12 +16,12 @@ ReverseServerName=aquarius.gw.fff.community. ################################################################# function GetZoneFileSerial() { - local FirstSOALineAndFollowing="/\S\+\s\+IN\s\+SOA\s/,\$!d;" + local FirstSOALineAndFollowing="^/\S\+\s\+IN\s\+SOA\s/,\$!d;" local RemoveComments=":a;s/;.*$//g;" - local EleminateLineBreaks=":a;N;\$!ba;s/\n//g;" - local SearchPrintSerial="s/\S\+\s\+IN\s\+SOA\s\+\S\+\s\+\S\+\s\+(\?\s\+\([0-9]*\).*/\1/" + 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 Serial=$(sed -e "$FirstSOALineAndFollowing""$RemoveComments""$EleminateLineBreaks""$SearchPrintSerial" "$1") + local Serial=$(sed -e "$FirstSOALineAndFollowing""$RemoveComments""$RemoveLineBreaks""$SearchPrintSerial" "$1") echo "$Serial" }