Skip to content

Commit

Permalink
Added RPZ with wildcards format
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorm committed Apr 23, 2022
1 parent afa2c3f commit 9d1cc32
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions resources/alt-formats/rpz_wildcards.txt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

# Author: Héctor Molinero Fernández <[email protected]>
# License: MIT, https://opensource.org/licenses/MIT
# Repository: https://github.com/hectorm/hblock

set -eu
export LC_ALL='C'

main() {
source="${1:?}"
target="${2:?}"
hblock="${3:-hblock}"

# shellcheck disable=SC2155
export HBLOCK_HEADER="$(cat <<-'EOF'
$TTL 2h
@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)
IN NS localhost.
EOF
)"
export HBLOCK_FOOTER=''
export HBLOCK_SOURCES="file://${source:?}"
export HBLOCK_ALLOWLIST=''
export HBLOCK_DENYLIST='hblock-check.molinero.dev'

export HBLOCK_REDIRECTION='.'
export HBLOCK_WRAP='1'
export HBLOCK_TEMPLATE='%D CNAME %R\n*.%D CNAME %R'
export HBLOCK_COMMENT=';'

export HBLOCK_LENIENT='false'
export HBLOCK_REGEX='false'
export HBLOCK_FILTER_SUBDOMAINS='true'
export HBLOCK_CONTINUE='false'

"${hblock:?}" -qO "${target:?}"
}

main "${@-}"

0 comments on commit 9d1cc32

Please sign in to comment.