Here's an init script for squeezeslave that I created for Arch Linux.

$ cat /etc/rc.d/squeezeslave

#!/bin/bash

# source application-specific settings
[ -f /etc/conf.d/squeezeslave ] && . /etc/conf.d/squeezeslave

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/squeezeslave`
case "$1" in
start)
stat_busy "Starting Squeezeslave Daemon"
if [ -z "$PID" ]; then
/usr/bin/squeezeslave --mac "$SSMAC" "$SLIMSERVER"  > /dev/null
2>&1 &
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon squeezeslave
stat_done
fi
;;
stop)
stat_busy "Stopping Squeezeslave Daemon"
[ ! -z "$PID" ]  && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon squeezeslave
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"  
esac

$ cat /etc/conf.d/squeezeslave
SSMAC="00:07:E9:C9:A2:81"
SLIMSERVER="cube"


-- 
ralphy
------------------------------------------------------------------------
ralphy's Profile: http://forums.slimdevices.com/member.php?userid=3484
View this thread: http://forums.slimdevices.com/showthread.php?t=22975

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix

Reply via email to