]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/vdr
Check added to prevent the vdr start if no DVB card is present
[people/pmueller/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! Alrady run!"
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 1;
30 fi
31
32 if [ "$(ps -A | grep runvdr)" != "" ]; then
33 boot_mesg "Error! Alrady run!"
34 echo_failure
35 exit 1;
36 fi
37
38 loadproc screen -dmS vdr /opt/vdr/bin/runvdr
39 ;;
40
41 stop)
42 boot_mesg "Stopping Video Disk Recorder..."
43 killall -s KILL -w runvdr
44 killproc /opt/vdr/bin/vdr
45 ;;
46
47 restart)
48 ${0} stop
49 sleep 1
50 ${0} start
51 ;;
52
53 status)
54 statusproc /opt/vdr/bin/runvdr
55 statusproc /opt/vdr/bin/vdr
56 ;;
57
58 *)
59 echo "Usage: ${0} {start|stop|restart|status}"
60 exit 1
61 ;;
62 esac
63
64 # End $rc_base/init.d/vdr