summaryrefslogtreecommitdiff
blob: 4e624bc2103546e4ad67bf4f702a5d3385226c98 (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift/files/gift.initd,v 1.6 2005/09/16 23:32:20 mkay Exp $

depend() {
	need net
}

start() {
	ebegin "Starting giFTd"
	start-stop-daemon --quiet --start -c ${USER} --make-pidfile \
		--pidfile /var/run/giftd.pid --exec /usr/bin/giftd \
		--nicelevel ${NICE} -- \
		--local-dir=${LOCAL_DIR} &>${LOG} &
		result=$?
	[ -z "`pgrep -u ${USER} giftd`" ] && result=1
	if [ $result -eq 1 ]; then
		eerror "Failed to start gift. Check ${LOG} for more information"
	fi;
	eend $result
}

stop() {
	ebegin "Stopping giFTd - please wait"
	start-stop-daemon --stop --quiet --pidfile /var/run/giftd.pid
	eend $?
}

restart() {
	svc_stop
	sleep 10
	svc_start
}