NetBSD/etc/rc.d/npf_boot
sevan 0e74c10957 No need to empose the script to be runnable during boot time, it prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by <pgoyette> for NPF but the issue is there in PF too.
2019-10-05 22:21:29 +00:00

34 lines
605 B
Bash

#!/bin/sh
#
# $NetBSD: npf_boot,v 1.2 2019/10/05 22:21:29 sevan Exp $
#
# PROVIDE: npf_boot
# REQUIRE: root bootconf mountcritlocal tty
# BEFORE: network
$_rc_subr_loaded . /etc/rc.subr
name="npf_boot"
rcvar="npf"
start_cmd="npf_boot_start"
stop_cmd=":"
npf_boot_start()
{
if [ -f /etc/npf.boot.conf ]; then
/sbin/npfctl reload /etc/npf.boot.conf
elif [ -f /etc/defaults/npf.boot.conf ]; then
/sbin/npfctl reload /etc/defaults/npf.boot.conf
else
warn "can't load initial npf rules; npf start aborted."
stop_boot
exit 1
fi
/sbin/npfctl start
}
load_rc_config $name
run_rc_command "$1"