diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2006-04-14 15:26:29 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2006-04-14 15:26:29 +0000 |
commit | af67aa71c017b25937f5e37c0ca8a22d99f3e00e (patch) | |
tree | a2e3873421df60a64764f68d5e8d7393191916b5 /sys-freebsd/freebsd-pf/files | |
parent | Updated madwifi USE flags. (diff) | |
download | gentoo-2-af67aa71c017b25937f5e37c0ca8a22d99f3e00e.tar.gz gentoo-2-af67aa71c017b25937f5e37c0ca8a22d99f3e00e.tar.bz2 gentoo-2-af67aa71c017b25937f5e37c0ca8a22d99f3e00e.zip |
Add init script for pf, based on the one contributed by Robert Sebastian Gerus in bug #129171.
(Portage version: 2.1_pre7-r5)
Diffstat (limited to 'sys-freebsd/freebsd-pf/files')
-rw-r--r-- | sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0-r1 (renamed from sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0) | 0 | ||||
-rw-r--r-- | sys-freebsd/freebsd-pf/files/pf.confd | 10 | ||||
-rwxr-xr-x | sys-freebsd/freebsd-pf/files/pf.initd | 50 |
3 files changed, 60 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0 b/sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0-r1 index 483a1c1a27c7..483a1c1a27c7 100644 --- a/sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0 +++ b/sys-freebsd/freebsd-pf/files/digest-freebsd-pf-6.0-r1 diff --git a/sys-freebsd/freebsd-pf/files/pf.confd b/sys-freebsd/freebsd-pf/files/pf.confd new file mode 100644 index 000000000000..41c2fb9e5ba9 --- /dev/null +++ b/sys-freebsd/freebsd-pf/files/pf.confd @@ -0,0 +1,10 @@ +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-pf/files/pf.confd,v 1.1 2006/04/14 15:26:29 flameeyes Exp $ + +# Defines where the rules file is found, by default /etc/pf.conf +PF_RULES_FILE=/etc/pf.conf + +# Extra options to pass to pfctl when loading the rules +# See pfctl(8) +# PF_OPTS= diff --git a/sys-freebsd/freebsd-pf/files/pf.initd b/sys-freebsd/freebsd-pf/files/pf.initd new file mode 100755 index 000000000000..221c654b29c2 --- /dev/null +++ b/sys-freebsd/freebsd-pf/files/pf.initd @@ -0,0 +1,50 @@ +#!/sbin/runscript +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-pf/files/pf.initd,v 1.1 2006/04/14 15:26:29 flameeyes Exp $ + +depend() { + need net +} + +checkconfig() { + if ! [[ -c /dev/pf ]]; then + ewarn "Pseudo-device /dev/pf not found." + + ebegin "Loading pf module" + if ! kldload pf; then + eerror "Unable to load pf module." + eend 1 + return 1 + fi + eend $? + + if ! [[ -c /dev/pf ]]; then + eerror "Pseudo-device /dev/pf still not found." + return 1 + fi + fi + + return 0 +} + +start() { + checkconfig || return 1 + + einfo "Starting firewall" + + if [ -r "${PF_RULES_FILE}" ]; then + einfo "Loading firewall rules" + /sbin/pfctl -qe -f ${PF_RULES_FILE:-/etc/pf.conf} ${PF_OPTS} + else + /sbin/pfctl -qe ${PF_OPTS} + fi + + eend $? +} + +stop() { + einfo "Stopping firewall" + /sbin/pfctl -qd || retval=1 + eend $? +} |