net-firewall/firehol: add 1.297 version
[moonrise.git] / net-firewall / firehol / files / firehol.initrd
blobfeb30d0a0b70a6ef108c9ead2153f7961237c000
1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/net-firewall/firehol/files/firehol.initrd,v 1.7 2008/04/26 10:00:56 alonbl Exp $
7 opts="start stop restart try status panic save"
9 depend() {
10         need localmount
11         after bootmisc
12         before net
13         provide firewall
16 checkrules() {
17         if [ ! -f ${FIREHOL_CONF} ]; then
18                 eerror "Not starting FireHOL. Create ${FIREHOL_CONF}"
19                 eerror "and fill it with some rules."
20                 eerror "man firehol.conf for more info."
21                 return 1
22         fi
25 start() {
26         checkrules || return 1
27         ebegin "Starting FireHOL"
28                 /usr/sbin/firehol ${FIREHOL_CONF} start > /dev/null
29         eend $? 
32 stop() {
33         ebegin "Stopping FireHOL"
34                 /usr/sbin/firehol stop > /dev/null
35         eend $?
38 restart() {
39         ebegin "Restarting Firewall"
40                 svc_stop;
41                 svc_start;
42         eend $?
46 try() {
47         ebegin "Trying FireHOL configuration"
48         /usr/sbin/firehol ${FIREHOL_CONF} try
49         eend $?
52 status() {
53         ebegin "Showing FireHOL status"
54         /usr/sbin/firehol status
55         eend $?
58 panic() {
59         ebegin "FireHOL PANIC"
60         /usr/sbin/firehol panic
61         eend $?
64 save() {
65         ebegin "Saving FireHOL configuration"
66         /usr/sbin/firehol save
67         eend $?