openbsd-tools/unbound/local-data-file-generator

16 lines
259 B
Text
Raw Permalink Normal View History

#!/usr/local/bin/bash
set -euo pipefail
AWK_SCRIPT=$(cat << 'EOF'
/^[ \t]*[^ \t]+[ \t]+([0-9]{1,3}\.){3}[0-9]{1,3}[ \t]*$/ {
print "local-data: \"" $1 " A " $2 "\""
print "local-data-ptr: \"" $2 " " $1 "\""
}
EOF
)
readonly AWK_SCRIPT
awk "$AWK_SCRIPT"