summaryrefslogtreecommitdiff
blob: 56a9c23a12313fa1f8ab4e7b9d9024ef6908da14 (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/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:  $

depend() {
	use dns
	need net
}

PIDFILE=/var/run/${RC_SVCNAME}.pid

start() {
	ebegin "Starting nmdcredir ${RC_SVCNAME}"
	if [ -z ${NMDCREDIR_HUBN} ]; then
		start-stop-daemon --start --pidfile "${PIDFILE}" -u ${NMDCREDIR_USER}:${NMDCREDIR_GROUP} -m -b /usr/bin/nmdcredir -- "${NMDCREDIR_PORT}" "${NMDCREDIR_ADDR}"
	else
		start-stop-daemon --start --pidfile "${PIDFILE}" -u ${NMDCREDIR_USER}:${NMDCREDIR_GROUP} -m -b /usr/bin/nmdcredir -- "${NMDCREDIR_PORT}" "${NMDCREDIR_ADDR}" \
																	"${NMDCREDIR_HUBN}" "${NMDCREDIR_MESS}"
	fi
	eend $?
}

stop() {
	ebegin "Stopping nmdcredir ${RC_SVCNAME}"
	start-stop-daemon --stop --pidfile "${PIDFILE}"
	eend $?
}