Fixed a bug where delete didn't work from a page where you supplied a "path".
[recordtv.git] / scripts / record_dvb_to_ts.sh
blob7a3a91987a725f397c4ed67d2f8f123df259be5d
1 #!/bin/bash
3 # Example:
5 # ./record_dvb_to_ts.sh "BBC ONE" eastenders 1800 \
6 # "../scheduled_recordings/eastenders.rtvinfo"
8 # ... will record into a file called eastenders.ts
10 # An optional fifth argument specifies the file extension. Default: .ts
12 CHANNEL="$1"
13 FILENAME="$2"
14 LENGTH_SECONDS="$3"
15 INFO_FILENAME="$4"
16 FILE_EXTENSION="$5"
18 if [ "$FILE_EXTENSION" == "" ]; then
20 FILE_EXTENSION="ts"
21 }; fi
23 date
25 echo '$ killall mplayer'
26 killall mplayer
28 if [ "$?" == "0" ]; then
30 echo '$ sleep 10s'
31 sleep 10s
32 }; fi
35 echo '$ mv "'$INFO_FILENAME'" "'$FILENAME'.rtvinfo"'
36 mv "$INFO_FILENAME" "$FILENAME.rtvinfo"
38 date
40 echo '$ mplayer -cache 8192 -dumpstream -dumpfile "'$FILENAME'.'$FILE_EXTENSION'.recording" "dvb://'$CHANNEL'" &'
41 mplayer -cache 8192 -dumpstream -dumpfile "$FILENAME.$FILE_EXTENSION.recording" "dvb://$CHANNEL" &
43 date
45 echo '$ sleep '$LENGTH_SECONDS's'
46 sleep ${LENGTH_SECONDS}s
48 date
50 echo '$ kill %mplayer'
51 kill %mplayer
53 echo '$ sleep 5s'
54 sleep 5s
56 echo '$ mv "'$FILENAME'.'$FILE_EXTENSION'.recording" "'$FILENAME'.'$FILE_EXTENSION'"'
57 mv "$FILENAME.$FILE_EXTENSION.recording" "$FILENAME.$FILE_EXTENSION"