2003-12-29 14:46:58 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# chkconfig: 2345 85 15
|
|
|
|
# description: mt-daapd is a multi-threaded DAAP server for iTunes
|
|
|
|
# processname: mt-daapd
|
|
|
|
# pidfile: /var/run/mt-daapd
|
|
|
|
#
|
|
|
|
|
|
|
|
# source function library
|
|
|
|
. /etc/init.d/functions
|
|
|
|
[ -e /etc/daapd.conf ]
|
|
|
|
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
start() {
|
|
|
|
echo -n $"Starting DAAP server: "
|
|
|
|
daemon mt-daapd
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mt-daapd
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo -n $"Shutting down DAAP server: "
|
2004-02-22 22:16:40 -05:00
|
|
|
killproc mt-daapd
|
2003-12-29 14:46:58 -05:00
|
|
|
RETVAL=$?
|
|
|
|
|
|
|
|
echo
|
|
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mt-daapd
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
RETVAL=$?
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
status mt-daapd
|
|
|
|
RETVAL=$?
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $RETVAL
|
|
|
|
|