Code: Select all
#!/bin/sh
#checkcd
device=$1
blocksize=`isoinfo -d -i $device | grep"^Logical block size is:" | cut -d"" -f 5`
if test"$blocksize" =""; then
echo catdevice FATAL ERROR: Blank blocksize >&2
exit
fi
blockcount=`isoinfo -d -i $device | grep"^Volume size is:" | cut -d"" -f 4`
if test"$blockcount" =""; then
echo catdevice FATAL ERROR: Blank blockcount >&2
exit
fi
command="dd if=$device bs=$blocksize count=$blockcount conv=notrunc,noerror"
echo"$command" >&2
$command
Then run
Code: Select all
$ su
< password >
chmod 755 checkcd
Code: Select all
./checkcd /dev/cdrom | md5sum