5 echo "You must be root to start aMule as daemon."
11 .
/etc
/conf.d
/amule.conf
16 echo "Unable to run aMule. You must set the user in /etc/conf.d/amule.conf."
18 elif [[ $AMULEUSER == "root" ]]
20 echo "Unable to run aMule. You must not run aMule as root."
24 confdir
=$
(su
-l $AMULEUSER -c "echo ~")/.aMule
25 logfile
=$
(su
-l $AMULEUSER -c "echo ~")/.aMule
/amuled.log
26 lockfile
=$
(su
-l $AMULEUSER -c "echo ~")/.aMule
/muleLock
28 PID
=`pidof -o %PPID /usr/bin/amuled`
30 [ -f $logfile ] && rm -f $logfile
34 stat_busy
"Starting aMule"
39 echo "Unable to run aMule, it is already running. If you're sure aMule is not already running, you can remove ${lockfile}."
43 [ ! -d $confdir ] && su
-l $AMULEUSER -c "mkdir -p $confdir"
45 [ -z "$PID" ] && su
-l $AMULEUSER -c "/usr/bin/amuled -o &> $logfile &"
51 if [ ! -z "$(grep "No other instances are running.
" $logfile)" ]
56 elif [ ! -z "$(grep "There seems to be an instance of aMule already running
" $logfile)" ]
68 stat_busy
"Stopping aMule"
71 [ ! -z "$PID" ] && kill $PID &> /dev
/null
74 echo "Unable to stop aMule. It is not running."
91 echo "usage: $0 {start|stop|restart}"