updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / mythplugins-0.24-fixes-svn-mythmusic / mtd.rc
blob1f46dfed15ba1e6aa4ff27cc701547de4c7fe70d
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/bin/mtd`
7 case "$1" in
8 start)
9 stat_busy "Starting Myth Transcoding Daemon"
10 [ -z "$PID" ] && /usr/bin/mtd -d
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 echo $PID > /var/run/mtd.pid
15 add_daemon mythtranscode
16 stat_done
19 stop)
20 stat_busy "Stopping Myth Transcoding Daemon"
21 [ ! -z "$PID" ] && kill $PID &>/dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon mtd
26 stat_done
29 restart)
30 $0 stop
31 $0 start
34 echo "usage: $0 {start|stop|restart}"
35 esac
36 exit 0