]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/dvd-writepart.in
- DVD writing/reading seems to be mostly working.
[bacula/bacula] / bacula / scripts / dvd-writepart.in
1 #!/bin/sh
2 #
3 # Bacula interface to growisofs, used to write to DVD+/-R(W)
4 #
5 #  $Id$
6 #
7 #  If you set in your Device resource
8 #
9 #  Write Part Command = "path-to-this-script/dvd-writepart %n %a %v"
10 #    you will have the following input to this script:
11 #
12 #  dvd-writepart "part_number"    "device"  "part_filename"
13 #                     $1             $2           $3
14 #
15 #  for example:
16 #
17 #  dvd-writepart 0 /dev/hda File-0001
18
19 MKISOFS=@MKISOFS@
20 GROWISOFS=@GROWISOFS@
21
22 GROWARGS="-use-the-force-luke=tty -quiet"
23
24 # Uncomment the following line if you do not want the tray to be reloaded
25 # when writing ends.
26 #GROWARGS="${GROWARGS} -use-the-force-luke=notray"
27
28 # Uncomment the following line if you have a Linux kernel >=2.6.8, and
29 # if you want to allow a session to start beyond the 4gb boundary.
30 #GROWARGS="${GROWARGS} -use-the-force-luke=4gms"
31
32 #### You should probably not modify anything below this line
33
34 if test $# -ne 3 ; then
35   echo "usage: dvd-writepart part_number device part_filename"
36   echo "  Wrong number of arguments arguments given (!= 3)."
37   exit 1
38 fi
39
40 # Setup arguments
41 partnum=$1
42 dev=$2
43 filename=$3
44
45 if test $partnum = 0 ; then
46   arg="-Z"
47 else
48   arg="-M"  
49 fi
50
51 echo Running ${GROWISOFS} ${GROWARGS} $arg $dev -R $filename...
52
53 ${GROWISOFS} ${GROWARGS} $arg $dev -R $filename
54 rtn=$?
55
56 exit $rtn