1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $FreeBSD: head/etc/rc.d/pfsync 150835 2005-10-02 18:59:02Z yar $
| 3# $FreeBSD: head/etc/rc.d/pfsync 165683 2006-12-31 10:37:18Z yar $
|
4# 5 6# PROVIDE: pfsync 7# REQUIRE: root mountcritlocal netif 8# KEYWORD: nojail 9 10. /etc/rc.subr 11 12name="pfsync" 13rcvar=`set_rcvar` 14start_precmd="pfsync_prestart" 15start_cmd="pfsync_start" 16stop_cmd="pfsync_stop"
| 4# 5 6# PROVIDE: pfsync 7# REQUIRE: root mountcritlocal netif 8# KEYWORD: nojail 9 10. /etc/rc.subr 11 12name="pfsync" 13rcvar=`set_rcvar` 14start_precmd="pfsync_prestart" 15start_cmd="pfsync_start" 16stop_cmd="pfsync_stop"
|
| 17required_modules="pf"
|
17 18pfsync_prestart() 19{
| 18 19pfsync_prestart() 20{
|
| 21 # XXX Currently pfsync cannot be a module as it must register 22 # a network protocol in a static kernel table. 23 if ! kldstat -q -m pfsync; then 24 warn "pfsync(4) must be statically compiled in the kernel." 25 return 1 26 fi 27
|
20 case "$pfsync_syncdev" in 21 '') 22 warn "pfsync_syncdev is not set." 23 return 1 24 ;; 25 esac
| 28 case "$pfsync_syncdev" in 29 '') 30 warn "pfsync_syncdev is not set." 31 return 1 32 ;; 33 esac
|
26 27 # load pf kernel module if needed 28 if ! kldstat -q -m pf ; then 29 if kldload pf ; then 30 info "pf module loaded." 31 else 32 warn "pf module failed to load." 33 return 1 34 fi 35 fi 36
| |
37 return 0 38} 39 40pfsync_start() 41{ 42 echo "Enabling pfsync." 43 ifconfig pfsync0 syncdev $pfsync_syncdev $pfsync_ifconfig up 44} 45 46pfsync_stop() 47{ 48 echo "Disabling pfsync." 49 ifconfig pfsync0 -syncdev down 50} 51 52load_rc_config $name 53run_rc_command "$1"
| 34 return 0 35} 36 37pfsync_start() 38{ 39 echo "Enabling pfsync." 40 ifconfig pfsync0 syncdev $pfsync_syncdev $pfsync_ifconfig up 41} 42 43pfsync_stop() 44{ 45 echo "Disabling pfsync." 46 ifconfig pfsync0 -syncdev down 47} 48 49load_rc_config $name 50run_rc_command "$1"
|