summaryrefslogtreecommitdiff
path: root/net-im/spectrum/files/spectrum.initd
blob: f3e5eb67aac0dc92941c1a99e15fed1bd05ae354 (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
#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

PROTOCOL=${SVCNAME#*.}

depend() {
        need net
        use jabber-server
}

start() {
	if [ -z "${PROTOCOL}" ] || [ ${SVCNAME} == "spectrum" ]; then	
		eerror "Please use /etc/init.d/spectrum.PROTOCOL instead of /etc/init.d/spectrum"
		eerror "to start Spectrum for the desired protocol."
		return 1
	fi

        ebegin "Starting ${PROTOCOL} Spectrum Transport"
        start-stop-daemon --start --pidfile ${PIDFILE} \
                 --chuid jabber:jabber --exec /usr/bin/spectrum -- ${CONFFILE}
        eend $?
}

stop() {
        ebegin "Stopping ${PROTOCOL} Spectrum Transport"
        start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
        eend $?
}