#!/bin/sh
#===============================================================================
# SSS Firmware
#===============================================================================
# File 			:	daap
# Who			:	JWB
# Description		:	This script starts / stops iTunes server
#
# Copyright		:	LG ELECTRONICS INC.
# history 		:	2008.07.21 edited last
#===============================================================================
cd /etc/init.d/


check_status()
{
	if [ $?=0 ]
	then
		echo "OK"
	else
		echo "FAILED"
	fi
}

#IPADDR=`ifconfig egiga0|grep inet" "addr|awk 'BEGIN {FS="addr:"} {print $2}'|awk '{print $1}'`
#HOSTNAME=`hostname`

case "$1" in
	start)
		echo -n "Starting iTunes Daemon"
		echo
		/usr/local/daapd/sbin/mt-daapd -r -c /etc/mt-daapd.conf
		check_status
		;;
	stop)
		echo -n "Stopping Pro iTunes Daemon"
		echo
		/usr/local/daapd/sbin/mt-daapd -k
		check_status
		;;
	*)
		echo "Usage: $0 {start|stop}"
		;;
esac



