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
+54
View File
@@ -0,0 +1,54 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: clear_route_policy
# BEFORE: pf
# KEYWORD: shutdown
#
. /etc/rc.subr
name="clear_route_policy"
desc="Policy Based Routing Reset"
start_cmd='clear_route_policy_start'
stop_cmd='clear_route_policy_stop'
rcvar='route_policy_enable'
load_rc_config 'route_policy'
[ -z "$route_policy_enable" ] && route_policy_enable='NO'
if [ -z "${route_policy_file}" ]
then
echo "Must have a route policy target file"
exit 1
fi
. /etc/router-conf/pf-framework.subr
clear_route_policy_start()
{
echo "" >/etc/router-conf/gen/pf.rules.conf
pfctl -a allow-hosts -f /dev/null
clear_all_policies
#pfctl -a route-policies -f ${route_policy_file}
}
clear_route_policy_stop()
{
echo "" >/etc/router-conf/gen/pf.rules.conf
pfctl -a allow-hosts -f /dev/null
clear_all_policies
#pfctl -a route-policies -f ${route_policy_file}
}
################ Epilogue
run_rc_command "$1"
# vim: ft=bash