Gentoo Archives: gentoo-commits

From: "Peter Volkov (pva)" <pva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-firewall/shorewall6/files: shorewall6.initd
Date: Thu, 22 Jan 2009 08:38:55
Message-Id: E1LPv5O-0006yD-Em@stork.gentoo.org
1 pva 09/01/22 08:38:50
2
3 Added: shorewall6.initd
4 Log:
5 Initial import, bug #255437, thank Vieri for all work.
6 (Portage version: 2.2_rc23/cvs/Linux i686)
7
8 Revision Changes Path
9 1.1 net-firewall/shorewall6/files/shorewall6.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/shorewall6/files/shorewall6.initd?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/shorewall6/files/shorewall6.initd?rev=1.1&content-type=text/plain
13
14 Index: shorewall6.initd
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2009 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/net-firewall/shorewall6/files/shorewall6.initd,v 1.1 2009/01/22 08:38:50 pva Exp $
20
21 opts="start stop restart clear reset refresh check"
22
23 depend() {
24 need net
25 provide firewall
26 after ulogd
27 }
28
29 start() {
30 ebegin "Starting firewall"
31 /sbin/shorewall6 -f start 1>/dev/null
32 eend $?
33 }
34
35 stop() {
36 ebegin "Stopping firewall"
37 /sbin/shorewall6 stop 1>/dev/null
38 eend $?
39 }
40
41 restart() {
42 # shorewall comes with its own control script that includes a
43 # restart function, so refrain from calling svc_stop/svc_start
44 # here. Note that this comment is required to fix bug 55576;
45 # runscript.sh greps this script... (09 Jul 2004 agriffis)
46 ebegin "Restarting firewall"
47 /sbin/shorewall6 status >/dev/null
48 if [ $? != 0 ] ; then
49 svc_start
50 else
51 if [ -f /var/lib/shorewall6/restore ] ; then
52 /sbin/shorewall6 restore
53 else
54 /sbin/shorewall6 restart 1>/dev/null
55 fi
56 fi
57 eend $?
58 }
59
60 clear() {
61 # clear will remove all the rules and bring the system to an unfirewalled
62 # state. (21 Nov 2004 eldad)
63
64 ebegin "Clearing all firewall rules and setting policy to ACCEPT"
65 /sbin/shorewall6 clear
66 eend $?
67 }
68
69 reset() {
70 # reset the packet and byte counters in the firewall
71
72 ebegin "Resetting the packet and byte counters in the firewall"
73 /sbin/shorewall6 reset
74 eend $?
75 }
76
77 refresh() {
78 # refresh the rules involving the broadcast addresses of firewall
79 # interfaces, the black list, traffic control rules and
80 # ECN control rules
81
82 ebegin "Refreshing firewall rules"
83 /sbin/shorewall6 refresh
84 eend $?
85 }
86
87 check() {
88 # perform cursory validation of the zones, interfaces, hosts, rules
89 # and policy files. CAUTION: does not parse and validate the generated
90 # iptables commands.
91
92 ebegin "Checking configuration files"
93 /sbin/shorewall6 check
94 eend $?
95 }