[BACK]Return to ipfilter CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

Annotation of src/etc/rc.d/ipfilter, Revision 1.3

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

CVSweb <webmaster@jp.NetBSD.org>