etc/services - sync with NetBSD-8
[minix.git] / etc / rc.d / npf
blobf1b58e0039343581c108d57f52b5319caf236082
1 #!/bin/sh
3 # $NetBSD: npf,v 1.3 2012/11/01 06:06:14 mrg Exp $
5 # Public Domain.
8 # PROVIDE: npf
9 # REQUIRE: root bootconf mountcritlocal tty network
10 # BEFORE: NETWORKING
12 $_rc_subr_loaded . /etc/rc.subr
14 name="npf"
15 rcvar=$name
17 config="/etc/npf.conf"
19 start_cmd="npf_start"
20 stop_cmd="npf_stop"
22 reload_cmd="npf_reload"
23 status_cmd="npf_status"
24 extra_commands="reload status"
26 npf_cfg_check()
28 if [ ! -f ${config} ]; then
29 warn "${config} is not readable; failed."
30 exit 1
34 npf_start()
36 echo "Enabling NPF."
37 npf_cfg_check
38 /sbin/npfctl reload
39 /sbin/npfctl start
42 npf_stop()
44 echo "Disabling NPF."
45 /sbin/npfctl stop
46 /sbin/npfctl flush
49 npf_reload()
51 echo "Reloading NPF ruleset."
52 npf_cfg_check
53 /sbin/npfctl reload
56 npf_status()
61 load_rc_config $name
62 run_rc_command "$1"