Add several important startup services

This commit is contained in:
2026-05-12 01:17:20 -04:00
parent bdd387b11c
commit f402f728e5
7 changed files with 319 additions and 10 deletions
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: allow_hosts
# REQUIRE: named
# KEYWORD: shutdown
#
. ${RC_ROUTER_HARNESS}/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'
if [ -z "${allow_hosts_rules}" ]
then
echo "Must have a route policy target file"
exit 1
fi
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()
{
true
}
################ Epilogue
run_rc_command "$1"
# vim: ft=bash