pfsync revision 180563
1#!/bin/sh 2# 3# $FreeBSD: head/etc/rc.d/pfsync 180563 2008-07-16 19:22:48Z dougb $ 4# 5 6# PROVIDE: pfsync 7# REQUIRE: FILESYSTEMS 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" 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 28 case "$pfsync_syncdev" in 29 '') 30 warn "pfsync_syncdev is not set." 31 return 1 32 ;; 33 esac 34 return 0 35} 36 37pfsync_start() 38{ 39 local _syncpeer 40 41 echo "Enabling pfsync." 42 if [ -n "${pfsync_syncpeer}" ]; then 43 _syncpeer="syncpeer ${pfsync_syncpeer}" 44 fi 45 ifconfig pfsync0 $_syncpeer syncdev $pfsync_syncdev $pfsync_ifconfig up 46} 47 48pfsync_stop() 49{ 50 echo "Disabling pfsync." 51 ifconfig pfsync0 -syncdev down 52} 53 54load_rc_config $name 55run_rc_command "$1" 56