I dunno what state this is in, but I might want to keep it.

This commit is contained in:
2026-09-02 05:55:59 -04:00
parent 6b02d9d58e
commit 0e27fd9cd5
10 changed files with 1137 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: allow_hosts
# REQUIRE: named
# KEYWORD: shutdown
#
. /etc/rc.subr
name="allow_hosts"
desc="Allow hosts by DNS (from local DNS)"
start_cmd='allow_hosts_start'
stop_cmd='allow_hosts_stop'
rcvar='allow_hosts_enable'
load_rc_config 'allow_hosts'
[ -z "$allow_hosts_enable" ] && allow_hosts_enable='NO'
if [ -z "${allow_hosts_rules}" ]
then
echo "Must have a route policy target file"
exit 1
fi
. /etc/router-conf/pf-framework.subr
allow_hosts_start()
{
echo "Running allow hosts"
echo "include \"${allow_hosts_rules}\"" > /etc/router-conf/gen/pf.rules.conf
pfctl -a allow-hosts -f ${allow_hosts_rules}
}
allow_hosts_stop()
{
}
################ Epilogue
run_rc_command "$1"
# vim: ft=bash