summaryrefslogtreecommitdiff
blob: 5537418db804fd7e1137ef87d90efe50e8ca4d14 (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2         
# $Header: /var/cvsroot/gentoo-x86/app-admin/bastille/files/bastille-3.0.2-firewall.init,v 1.1 2005/07/31 05:21:10 battousai Exp $

opts="start stop"
BASTILLEPREFIX="/usr/share/Bastille"

depend() {
        need logger
}

start() {
	# "Borrowed" from the original bastille-firewall init script ((c) P. Watkins)
	REALSCRIPT=${BASTILLEPREFIX}/bastille-ipchains
	if [ -n "$(uname -r | awk -F. ' $1 == 2 && $2 > 2 {print}')" ]; then
	        # We are using Linux 2.3 or newer; use the netfilter script if available
	        if [ -x ${BASTILLEPREFIX}/bastille-netfilter ]; then
	                REALSCRIPT=${BASTILLEPREFIX}/bastille-netfilter
	        fi
	fi
	
        ebegin "Starting bastille-firewall"
        $REALSCRIPT start
        eend $? "Failed to start bastille-firewall"
}

stop() {
	# "Borrowed" from the original bastille-firewall init script ((c) P. Watkins)
	REALSCRIPT=${BASTILLEPREFIX}/bastille-ipchains
	if [ -n "$(uname -r | awk -F. ' $1 == 2 && $2 > 2 {print}')" ]; then
	        # We are using Linux 2.3 or newer; use the netfilter script if available
	        if [ -x ${BASTILLEPREFIX}/bastille-netfilter ]; then
	                REALSCRIPT=${BASTILLEPREFIX}/bastille-netfilter
	        fi
	fi
	
	ebegin "Stopping bastille-firewall"
	$REALSCRIPT stop
	eend $? "Failed to stop bastille-firewall"
}