Home | History | Annotate | Line # | Download | only in rc.d
      1 #!/bin/sh
      2 #
      3 # $NetBSD: npf_boot,v 1.6 2021/11/30 11:00:29 sborrill Exp $
      4 #
      5 
      6 # PROVIDE: npf_boot
      7 # REQUIRE: root bootconf CRITLOCALMOUNTED tty
      8 # BEFORE: network
      9 
     10 $_rc_subr_loaded . /etc/rc.subr
     11 
     12 name="npf_boot"
     13 rcvar="npf"
     14 start_cmd="npf_boot_start"
     15 stop_cmd=":"
     16 
     17 npf_boot_start()
     18 {
     19 	if [ -f /etc/npf.boot.conf ]; then
     20 		/sbin/npfctl reload /etc/npf.boot.conf
     21 	elif [ -f /etc/defaults/npf.boot.conf ]; then
     22 		/sbin/npfctl reload /etc/defaults/npf.boot.conf
     23 	else
     24 		warn "can't load initial npf rules; npf start aborted."
     25 		stop_boot
     26 		exit 1
     27 	fi
     28 
     29 	/sbin/npfctl start
     30 }
     31 
     32 load_rc_config $name
     33 load_rc_config_var npf npf
     34 run_rc_command "$1"
     35