Lines 1-82
Link Here
|
1 |
#!/sbin/runscript |
|
|
2 |
# Copyright 1999-2014 Gentoo Foundation |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Header: /var/cvsroot/gentoo-x86/net-firewall/shorewall6-lite/files/4.5.21.10/shorewall6-lite.initd,v 1.1 2014/06/12 14:32:38 tomwij Exp $ |
5 |
|
6 |
description='The Shoreline Firewall 6 Lite, more commonly known as "Shorewall6 Lite", is' |
7 |
description="${description} a high-level tool for configuring Netfilter." |
8 |
|
9 |
extra_commands="clear" |
10 |
extra_started_commands="reset" |
11 |
|
12 |
description_clear="Clear will remove all rules and chains installed by" |
13 |
description_clear="${description_clear} Shorewall6 Lite. The firewall is" |
14 |
description_clear="${description_clear} then wide open and unprotected." |
15 |
|
16 |
description_reset="All the packet and byte counters in the firewall are reset." |
17 |
|
18 |
depend() { |
19 |
need net |
20 |
provide firewall |
21 |
after ulogd |
22 |
} |
23 |
|
24 |
status() { |
25 |
local _retval |
26 |
/sbin/shorewall6-lite status 1>/dev/null |
27 |
_retval=$? |
28 |
if [ ${_retval} = '0' ]; then |
29 |
einfo 'status: started' |
30 |
mark_service_started "${SVCNAME}" |
31 |
return 0 |
32 |
else |
33 |
einfo 'status: stopped' |
34 |
mark_service_stopped "${SVCNAME}" |
35 |
return 3 |
36 |
fi |
37 |
} |
38 |
|
39 |
start() { |
40 |
ebegin "Starting shorewall6-lite" |
41 |
/sbin/shorewall6-lite ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null |
42 |
eend $? |
43 |
} |
44 |
|
45 |
stop() { |
46 |
ebegin "Stopping shorewall6-lite" |
47 |
/sbin/shorewall6-lite ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null |
48 |
eend $? |
49 |
} |
50 |
|
51 |
restart() { |
52 |
# shorewall comes with its own control script that includes a |
53 |
# restart function, so refrain from calling svc_stop/svc_start |
54 |
# here. Note that this comment is required to fix bug 55576; |
55 |
# runscript.sh greps this script... (09 Jul 2004 agriffis) |
56 |
|
57 |
ebegin "Restarting shorewall6-lite" |
58 |
/sbin/shorewall6-lite status 1>/dev/null |
59 |
if [ $? != 0 ] ; then |
60 |
svc_start |
61 |
else |
62 |
/sbin/shorewall6-lite ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null |
63 |
fi |
64 |
eend $? |
65 |
} |
66 |
|
67 |
clear() { |
68 |
# clear will remove all the rules and bring the system to an unfirewalled |
69 |
# state. (21 Nov 2004 eldad) |
70 |
|
71 |
ebegin "Clearing all shorewall6-lite rules and setting policy to ACCEPT" |
72 |
/sbin/shorewall6-lite ${OPTIONS} clear 1>/dev/null |
73 |
eend $? |
74 |
} |
75 |
|
76 |
reset() { |
77 |
# reset the packet and byte counters in the firewall |
78 |
|
79 |
ebegin "Resetting the packet and byte counters in shorewall6-lite" |
80 |
/sbin/shorewall6-lite ${OPTIONS} reset 1>/dev/null |
81 |
eend $? |
82 |
} |