2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/net-p2p/amule/files/amuleweb.initd,v 1.7 2008/02/04 16:51:51 armin76 Exp $
12 if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
13 eerror "You must start and configure amuleweb before launch it. Sorry."
17 if pgrep -u ${AMULEUSER} amuleweb >/dev/null; then
18 eerror "An instance of aMule webserver is already running"
22 if [ -e /var/run/amuleweb.pid ]; then
23 rm /var/run/amuleweb.pid
26 OPTIONS="-h ${AMULEHOST} -p ${AMULEPORT} -P ${AMULEPWD} -A ${WEBPWD} -t ${TEMPLATE} -q"
28 ebegin "Starting aMule WebServer"
29 env HOME="${AMULEHOME}" start-stop-daemon --start \
31 --make-pidfile --pidfile /var/run/amuleweb.pid \
33 -x /usr/bin/amuleweb -- ${OPTIONS} &>${LOG}
36 if ! pgrep -u ${AMULEUSER} amuleweb > /dev/null; then
37 eerror "aMule daemon can't be started! Check logfile: ${LOG}"
45 ebegin "Stopping aMule WebServer"
46 start-stop-daemon --oknodo --stop --pidfile /var/run/amuleweb.pid &>/dev/null