5 [ -f "$cd_image_iso" ] && die "$cd_image_iso found, remove it first"
6 [ -d "$source_dir" ] && die "$source_dir found, remove it first"
9 while getopts bdl:Ow opt; do
13 l ) label="$OPTARG" ;;
18 shift `expr $OPTIND - 1`
21 if [ -z "$cdrw" ]; then
33 if [ -z "$label" ]; then
34 label="`get_label \"$device\"`"
35 if [ -z "$label" ]; then
36 echo -n "Enter label: "
42 echo "Reading source disk, please wait..."
44 mount "$fs" || die "Cannot mount the source disk"
45 cpdir "$fs" "$work_dir" || die "Cannot copy the source disk"
48 chmod -R u+w "$work_dir"
49 mv "$work_dir" "$source_dir"
54 if [ -z "$dvd" ]; then
55 mk-image "$label" || die "Cannot make new disk image"
62 if [ -z "$dvd" ]; then
63 until wodim dev="$dev_scsi" -atip >/dev/null 2>&1; do
64 echo "Insert blank disk into CD/DVD-Burner and press Enter..."
67 if [ "$blank" = blank ]; then
71 fi || die "Error burning disk"
75 echo "Insert blank disk into CD/DVD-Burner and press Enter..."
77 dvdrec-data "$label" || die "Error burning disk"
82 if [ -z "$cdrw" ]; then
83 echo "Insert newly written disk into CD/DVD-ROM and press Enter..."
87 echo "Comparing, please wait..."
91 mount "$fs" || die "Cannot mount the disk"
94 if diff -r --speed-large-files . "$fs"; then
95 echo "The disk has been successfully copied!"
102 if [ -z "$dvd" ]; then
103 rm -r "$cd_image_iso"
105 exec rm -r "$source_dir"