summaryrefslogtreecommitdiff
blob: 2c397a5e413f9df17feb214159d72288440ab942 (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
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

opts="start stop"

depend() {
        need net
}

start() {
        ebegin "Starting hellanzb"
        if ! check_config ; then
		eend 1
		return 1
	fi

	export PATH="${PATH}:/opt/bin"
        start-stop-daemon --quiet --start -c ${HELLA_USER} \
		-g ${HELLA_GROUP} --name hellanzb.py \
                --exec /usr/bin/hellanzb.py -- \
                -D -c ${HELLA_CONFIGFILE} ${HELLA_OPTS} &> /dev/null
	eend $?
}

stop() {
	ebegin "Stopping hellanzb"
	start-stop-daemon --quiet --stop \
		--name hellanzb.py
	eend $?
}

check_config() {
	if [ ! -e ${HELLA_CONFIGFILE} ] ; then
		eerror "ERROR: can't find ${HELLA_CONFIGFILE}."
		return 1
	else
		return 0
	fi
}