Annotation of src/etc/rc.d/ipfilter, Revision 1.4
1.1 lukem 1: #!/bin/sh
2: #
1.4 ! lukem 3: # $NetBSD: ipfilter,v 1.3 2000/04/30 13:23:33 lukem Exp $
1.1 lukem 4: #
5:
6: # PROVIDE: ipfilter
7: # REQUIRE: root beforenetlkm mountcritlocal tty
8:
9: . /etc/rc.subr
10:
11: name="ipfilter"
12: start_cmd="ipfilter_start"
13: stop_precmd="checkyesno ipfilter && [ -f /etc/ipf.conf ]"
14: stop_cmd="ipfilter_stop"
15: reload_precmd="$stop_precmd"
16: reload_cmd="ipfilter_reload"
1.3 lukem 17: extra_commands="reload"
1.1 lukem 18:
19: ipfilter_start()
20: {
1.2 veego 21: if ! checkyesno ipfilter; then
1.1 lukem 22: return 0
23: fi
24:
25: # if /etc/ipf.conf isn't readable, abort the boot rather
26: # than risk a security problem
27: #
28: if [ ! -f /etc/ipf.conf ]; then
29: err 1 "/etc/ipf.conf not readable; ipfilter start aborted."
30: fi
31: echo "Enabling ipfilter."
32: /sbin/ipf -E -Fa -f /etc/ipf.conf
33: }
34:
35: ipfilter_stop()
36: {
37: echo "Disabling ipfilter."
38: /sbin/ipf -D
39: }
40:
41: ipfilter_reload()
42: {
43: echo "Reloading ipfilter rules."
44: /sbin/ipf -I -Fa -f /etc/ipf.conf
45: if [ $? -eq 0 ]; then
46: /sbin/ipf -s
47: else
48: warn "Reload failed; not swapping to new ruleset."
49: fi
50: }
51:
1.4 ! lukem 52: load_rc_config $name
1.3 lukem 53: run_rc_command "$1"
CVSweb <webmaster@jp.NetBSD.org>