NetBSD/etc/rc.d/npf_boot

34 lines
610 B
Bash

#!/bin/sh
#
# $NetBSD: npf_boot,v 1.1.4.1 2019/10/06 11:13:35 martin 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"