2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/net-p2p/amule/files/amuled.initd,v 1.4 2007/07/23 12:07:54 armin76 Exp $
11 if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
12 eerror "You must start and configure amuled before launch it. Sorry."
16 if pgrep -u ${AMULEUSER} amuled >/dev/null; then
17 eerror "An instance of aMule webserver is already running"
20 if [ -e /var/run/amuled.pid ]; then
21 rm /var/run/amuled.pid
24 ebegin "Starting aMule Daemon"
25 env HOME="${AMULEHOME}" start-stop-daemon --start \
26 --quiet --background \
27 --make-pidfile --pidfile /var/run/amuled.pid \
29 -x /usr/bin/amuled >${LOG}
32 if ! pgrep -u ${AMULEUSER} amuled > /dev/null; then
33 eerror "aMule daemon can't be started! Check logfile: ${LOG}"
39 ebegin "Stopping aMule daemon -- please wait"
40 start-stop-daemon --oknodo --stop --pidfile /var/run/amuled.pid &>/dev/null
46 while `pgrep -u ${AMULEUSER} amuled >/dev/null`; do