summaryrefslogtreecommitdiff
blob: 8ea6b4d99efa39258efc49f0533c54219c9a2a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-firewall/firehol/files/firehol.initrd,v 1.3 2004/10/02 18:44:02 centic Exp $


opts="start stop restart try status panic save"

depend() {
	before net
	provide firewall
}

checkrules() {
	if [ ! -f ${FIREHOL_CONF} ]; then
		eerror "Not starting FireHOL. Create ${FIREHOL_CONF}"
		eerror "and fill it with some rules."
		eerror "man firehol.conf for more info."
		return 1
	fi
}

start() {
	checkrules || return 1
	ebegin "Starting FireHOL"
		/usr/sbin/firehol start ${FIREHOL_CONF} > /dev/null
	eend $? 
}

stop() {
	ebegin "Stopping FireHOL"
		/usr/sbin/firehol stop > /dev/null
	eend $?
}

restart() {
        ebegin "Restarting Firewall"
                svc_stop;
                svc_start;
        eend $?
}


try() {
	ebegin "Trying FireHOL configuration"
	/usr/sbin/firehol try
	eend $?
}

status() {
	ebegin "Showing FireHOL status"
	/usr/sbin/firehol status
	eend $?
}

panic() {
	ebegin "FireHOL PANIC"
	/usr/sbin/firehol panic
	eend $?
}

save() {
	ebegin "Saving FireHOL configuration"
	/usr/sbin/firehol save
	eend $?
}