1#!/bin/rc 2# dupdisc indev outdev - duplicate all blu-ray disc data tracks 3rfork ne 4if (! ~ $#* 2 || ~ $1 $2 || ~ $1 /dev/* || ~ $2 /dev/*) { 5 echo usage: $0 indev outdev >[1=2] 6 exit usage 7} 8echo copying /dev/$1 tracks to /dev/$2 9sleep 2 10 11umount /mnt/cd >[2]/dev/null 12cdfs -d /dev/$1 || exit 13cdfs -d /dev/$2 -m /n/copy || exit 14 15for (t in `{ls -p /mnt/cd | grep '^d'}) { 16 echo $t: 17 grep next /n/copy/ctl 18 pump -b 1048576 -k 51200 -d 10 </mnt/cd/$t >/n/copy/wd/$t 19 ls -l /n/copy 20} 21echo 'remember to *not* rm /mnt/cd/wd' >[1=2] 22# don't remove /mnt/cd/wd, since that would finalize the disc 23# and bugger the permanent toc, at least on bd-r. 24