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

# NB: Standard config is in /etc/boa/boa.conf
# NB: Arguments to pass to boa are in /etc/conf.d/boa

command=/usr/sbin/boa
command_args="${BOA_OPTS}"
pidfile="/run/boa.pid"

depend() {
	need net
}

start_pre() {
	if [ -e /etc/conf.d/boa ] && [ -n "${BOA_OPTS}" ]; then
		SR="$(echo ${BOA_OPTS} | awk '{ FS = " " } { print $2 }')"
	else
		SR=/etc/boa
	fi

	if [ ! -e ${SR}/boa.conf ] ; then
		eerror "You need a ${SR}/boa.conf to run Boa"
		eerror "There is a sample file in /usr/share/docs/boa"
		return 1
	fi
}