blob: c75bdf0a23f9b695846a38175899d957b88b6d46 (
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
|
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
DAEMON=/usr/sbin/bitflu.pl
PIDDIR=/var/run/bitflu
PIDFILE=${PIDDIR}/bitflu.pid
CONFFILE=/etc/bitflu/bitflu.config
depend() {
need net
}
checkconfig() {
if [ ! -f ${CONFFILE} ]; then
eerror "No config file ${CONFFILE}"
return 1
fi
if [ ! -d ${PIDDIR} ] && ! mkdir -p ${PIDDIR}; then
eerror "Failed to create ${PIDDIR}"
return 1
fi
chown bitflu:bitflu ${PIDDIR}
}
start() {
checkconfig || return 1
ebegin "Starting bitflu"
start-stop-daemon --start --pidfile "${PIDFILE}" --user bitflu:bitflu \
--exec "${DAEMON}" -- --config="${CONFFILE}" --daemon -q >/dev/null 2>&1
eend $?
}
stop() {
ebegin "Stoping bitflu"
start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${DAEMON}"
eend $?
}
restart() {
svc_stop
sleep 2
svc_start
}
|