#!/sbin/runscript # opts="${opts}" depend() { need net use dancer-ircd } start() { ebegin Starting ${DAEMON##*/} if [[ "$DAEMON_USER" != "root" ]] && [[ -n "$DAEMON_USER" ]] ; then eecho -n " as $DAEMON_USER" fi HOME=`getent passwd | grep ^${DAEMON_USER}: | perl -pe 's/.*://;'` \ start-stop-daemon -S -b -c $DAEMON_USER -N $DAEMON_NICE -p $DAEMON_PID_FILE -m -x $DAEMON -- "$DAEMON_OPTIONS" eend $? } stop() { ebegin Stopping ${DAEMON##*/} start-stop-daemon -K -o -p $DAEMON_PID_FILE STAT=$? rm $DAEMON_PID_FILE eend $STAT }