21 lines
628 B
Plaintext
21 lines
628 B
Plaintext
# TODO header :D
|
|
# TODO it would be cool to print a warning if a generated anchor is unused in pf.conf
|
|
|
|
DESTDIR=/etc/pf.d
|
|
|
|
proto="$(cat "$__object/parameter/proto")"
|
|
from="$(cat "$__object/parameter/from")"
|
|
to="$(cat "$__object/parameter/to")"
|
|
state="$(cat "$__object/parameter/state")"
|
|
|
|
from="$(echo $from | sed 's/:/ port /')"
|
|
to="$(echo $to | sed 's/:/ port /')"
|
|
|
|
anchorname="$(echo $__object_id | cut -d/ -f1)"
|
|
rule="rdr pass log proto $proto from any to $from -> $to"
|
|
|
|
__directory "$DESTDIR" --parents
|
|
|
|
require="__directory/$DESTDIR" \
|
|
__line __pf_rdr/$__object_id --state $state --line "$rule" --file $DESTDIR/$anchorname
|