Files
sablink-distro/net-p2p/amuleadu/files/amuleweb.initd
T
Mitch Harder 3b49f3ec11 [net-p2p/amuleadu] Added new ebuild for net-p2p/amuleadu-2010.1
Added a new ebuild for net-p2p/amuleadu-2010.1 to facilitate
processing of Sabayon Linux bug 877.
http://bugs.sabayon.org/show_bug.cgi?id=877
2010-04-30 09:56:01 -05:00

50 lines
1.2 KiB
Plaintext

#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/amule/files/amuleweb.initd,v 1.7 2008/02/04 16:51:51 armin76 Exp $
depend() {
need net
use amuled
}
start() {
if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
eerror "You must start and configure amuleweb before launch it. Sorry."
return 1
fi
if pgrep -u ${AMULEUSER} amuleweb >/dev/null; then
eerror "An instance of aMule webserver is already running"
return 1
fi
if [ -e /var/run/amuleweb.pid ]; then
rm /var/run/amuleweb.pid
fi
OPTIONS="-h ${AMULEHOST} -p ${AMULEPORT} -P ${AMULEPWD} -A ${WEBPWD} -t ${TEMPLATE} -q"
ebegin "Starting aMule WebServer"
env HOME="${AMULEHOME}" start-stop-daemon --start \
--quiet -b \
--make-pidfile --pidfile /var/run/amuleweb.pid \
-c ${AMULEUSER} \
-x /usr/bin/amuleweb -- ${OPTIONS} &>${LOG}
sleep 1
if ! pgrep -u ${AMULEUSER} amuleweb > /dev/null; then
eerror "aMule daemon can't be started! Check logfile: ${LOG}"
eend 1
return 1
fi
eend $?
}
stop() {
ebegin "Stopping aMule WebServer"
start-stop-daemon --oknodo --stop --pidfile /var/run/amuleweb.pid &>/dev/null
eend $?
}