| #!/sbin/runscript |
| # Copyright 1999-2004 Gentoo Foundation |
| # Distributed under the terms of the GNU General Public License v2 |
| # $Id$ |
| |
| 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=$? |
| sleep 1 |
| [ -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 |
| } |