summaryrefslogtreecommitdiff
blob: 3d8c2a46f7e327afd26b6846a402e3dbea8f3e59 (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
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

extra_commands="save panic try"
extra_started_commands="reload"

depend() {
	need localmount
	after bootmisc
	before net
	provide firewall
}

start_pre() {
	if [ ! -f ${SANEWALL_CONFIG} ]; then
		eerror "Not starting sanewall, missing config file ${SANEWALL_CONFIG}."
		return 1
	fi
}

start() {
	ebegin "Starting sanewall"
	/usr/sbin/sanewall ${SANEWALL_OPTS} ${SANEWALL_CONFIG} start >/dev/null
	eend $?
}

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

try() {
	ebegin "Trying sanewall configuration"
	/usr/sbin/sanewall ${SANEWALL_OPTS} ${SANEWALL_CONFIG} try
	eend $?
}

status() {
	ebegin "Showing sanewall status"
	/usr/sbin/sanewall ${SANEWALL_OPTS} status
	eend $?
}

panic() {
	ebegin "sanewall panic"
	/usr/sbin/sanewall ${SANEWALL_OPTS} panic
	eend $?
}

save() {
	ebegin "Saving sanewall configuration"
	/usr/sbin/sanewall ${SANEWALL_OPTS} save
	eend $?
}