NetBSD/etc/rc.d/npf_boot

34 lines
608 B
Bash

#!/bin/sh
#
# $NetBSD: npf_boot,v 1.4 2020/09/08 12:52:18 martin Exp $
#
# PROVIDE: npf_boot
# REQUIRE: root bootconf CRITLOCALMOUNTED 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"