vdr backup include added
[ipfire-2.x.git] / src / initscripts / init.d / vdr
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/vdr
4 #
5 # Description : This is a script that starts vdr as deamon
6 #
7 # Authors     : Arne Fitzenreiter (arne@ipfire.org)
8 #
9 # Version     : 01.00
10 #
11 # Notes       :
12 #
13 ########################################################################
14
15 . /etc/sysconfig/rc
16 . ${rc_functions}
17
18 case "${1}" in
19         start)
20                 boot_mesg "Starting Video Disk Recorder..."
21                 if [ "$(ps -A | grep runvdr)" != "" ]; then
22                    boot_mesg "Error! Already running!"
23                    echo_failure
24                    exit 1;
25                 fi
26                 if [ ! -e /dev/dvb/adapter0/frontend0 ]; then
27                    boot_mesg "Error! No DVB tuner found."
28                    echo_failure
29                    exit 0;
30                 fi      
31                 loadproc screen -dmS vdr /opt/vdr/bin/runvdr
32                 ;;
33                 
34         stop)
35                 boot_mesg "Stopping Video Disk Recorder..."
36                 killall -s KILL -w runvdr
37                 killproc /opt/vdr/bin/vdr
38                 ;;
39
40         restart)
41                 ${0} stop
42                 sleep 1
43                 ${0} start
44                 ;;
45
46         status)
47                 statusproc /opt/vdr/bin/runvdr
48                 statusproc /opt/vdr/bin/vdr
49                 ;;
50
51         *)
52                 echo "Usage: ${0} {start|stop|restart|status}"
53                 exit 1
54                 ;;
55 esac
56
57 # End $rc_base/init.d/vdr