npf_boot revision 1.1
11.1Ssevan#!/bin/sh
21.1Ssevan#
31.1Ssevan# $NetBSD: npf_boot,v 1.1 2019/04/02 01:50:32 sevan Exp $
41.1Ssevan#
51.1Ssevan
61.1Ssevan# PROVIDE: npf_boot
71.1Ssevan# REQUIRE: root bootconf mountcritlocal tty
81.1Ssevan# BEFORE: network
91.1Ssevan
101.1Ssevan$_rc_subr_loaded . /etc/rc.subr
111.1Ssevan
121.1Ssevanname="npf_boot"
131.1Ssevanrcvar="npf"
141.1Ssevanstart_cmd="npf_boot_start"
151.1Ssevanstop_cmd=":"
161.1Ssevan
171.1Ssevannpf_boot_start()
181.1Ssevan{
191.1Ssevan	if [ "$autoboot" != "yes" ]; then
201.1Ssevan		err 1 "This script should only be executed at boot time."
211.1Ssevan	fi
221.1Ssevan
231.1Ssevan	if [ -f /etc/npf.boot.conf ]; then
241.1Ssevan		/sbin/npfctl reload /etc/npf.boot.conf
251.1Ssevan	elif [ -f /etc/defaults/npf.boot.conf ]; then
261.1Ssevan		/sbin/npfctl reload /etc/defaults/npf.boot.conf
271.1Ssevan	else
281.1Ssevan		warn "can't load initial npf rules; npf start aborted."
291.1Ssevan		stop_boot
301.1Ssevan		exit 1
311.1Ssevan	fi
321.1Ssevan
331.1Ssevan	/sbin/npfctl start
341.1Ssevan}
351.1Ssevan
361.1Ssevanload_rc_config $name
371.1Ssevanrun_rc_command "$1"
38