File amule-daemon.init of Package aMule-git

#!/bin/sh
#
#
### BEGIN INIT INFO
# Provides:          amule-daemon
# Required-Start:    $network $remote_fs
# Required-Stop:     $network $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Start the aMule daemon client
# Description:       Start the aMule daemon client
### END INIT INFO
# 

AMULE_BIN=/usr/bin/amuled
test -x $AMULE_BIN || { echo "$AMULE_BIN not installed"; 
	if [ "$1" = "stop" ]; then exit 0;
	else exit 5; fi; }

AMULE_CONFIG=/etc/sysconfig/amule-daemon
test -r $AMULE_CONFIG || { echo "$AMULE_CONFIG not existing";
	if [ "$1" = "stop" ]; then exit 0;
	else exit 6; fi; }

. $AMULE_CONFIG

. /etc/rc.status

rc_reset


case "$1" in
    start)
	echo -n "Starting aMule daemon "
	/sbin/startproc -u $DAEMON_USER $AMULE_BIN $DAEMON_ARGS > /dev/null 2>&1
	rc_status -v
	;;
    stop)
	echo -n "Shutting down aMule daemon "
	/sbin/killproc -TERM $AMULE_BIN
	rc_status -v
	;;
    restart)
	$0 stop
	$0 start
	rc_status
	;;
    status)
	echo -n "Checking for service aMule daemon "
	/sbin/checkproc $AMULE_BIN
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
	;;
esac
rc_exit