Ein Kumpel hat mir das Script überarbeitet, aber es funzt trotzdem noch nicht. Sieht jetzt so aus:
Code:
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: amule
# Required-Start: $network
# Required-Stop: $network
# Required-Start:
# Required-Stop:
# Description: aMule-Webserver-Daemon
### END INIT INFO
. /etc/rc.status
rc_reset
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/amuled
WEB=/usr/local/bin/amuleweb
NAME=amule_script
DESC=amuled
RUNAMULE=yes
USER=root
test -x $DAEMON || exit 0
# Include amule defaults if available
if [ -f /etc/default/amule ] ; then
. /etc/default/amule
fi
if [ "$RUNAMULE" != "yes" ];then
echo "Amule not to be started. Edit /etc/default/amule first."
exit 1
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC..... "
su $USER -c "$DAEMON -f"
while ! netstat -l -n -p -t | grep -q amuled ; do sleep 1 ; done
su $USER -c "$WEB --quiet &"
rc_status -v
;;
stop)
echo -n "Stopping $DESC..... "
killall --quiet --ignore-case $WEB
killall --quiet --ignore-case $DAEMON
rc_status -v
;;
status)
echo -n "Checking for $DESC..... "
checkproc -p ${PID_FILE} ${PURE_BIN}
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
rc_exit Die Ausgaben auf Deine Fragen sind:
linux-z66f:~ # which amuled
/usr/local/bin/amuled
linux-z66f:~ # which amuleweb
/usr/local/bin/amuleweb
linux-z66f:~ # which amule
/usr/local/bin/amule
Lesezeichen