gentoo/net-im/spectrum/files/spectrum2.initd

36 lines
783 B
Plaintext
Raw Normal View History

#!/sbin/openrc-run
2018-09-20 12:17:02 +02:00
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
2018-09-20 12:17:02 +02:00
SPECTRUM2_GROUP="spectrum"
SPECTRUM2_MANAGER="/usr/bin/spectrum2_manager"
SPECTRUM2_USER="spectrum"
depend() {
need net
}
start() {
2018-09-20 12:17:02 +02:00
ebegin "Starting Spectrum2 Transport"
start-stop-daemon --start --group ${SPECTRUM2_GROUP} --user ${SPECTRUM2_USER} \
--exec ${SPECTRUM2_MANAGER} start
eend $?
}
start_pre() {
checkpath -d -o ${SPECTRUM2_USER}:${SPECTRUM2_GROUP} -q /run/spectrum2
}
status() {
ebegin "Status Spectrum2 Transport"
${SPECTRUM2_MANAGER} status
eend $?
}
stop() {
2018-09-20 12:17:02 +02:00
ebegin "Stopping Spectrum2 Transport"
start-stop-daemon --start --group ${SPECTRUM2_GROUP} --user ${SPECTRUM2_USER} \
--exec ${SPECTRUM2_MANAGER} stop
eend $?
}