From: Carl Baldwin Date: Fri, 28 Oct 2005 04:02:51 +0000 (-0600) Subject: burning script X-Git-Tag: release-0.4~49 X-Git-Url: http://git.pippins.net/embedvideo/.git/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/images/checkmark.gif?a=commitdiff_plain;h=22a92db58dcdc81dd77c93d27dee491c3c15c87a;p=backups%2F.git burning script --- diff --git a/scripts/burn-imgs.sh b/scripts/burn-imgs.sh new file mode 100755 index 0000000..1f38f7c --- /dev/null +++ b/scripts/burn-imgs.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +mailto=carl@ecbaldwin.net +dev="/dev/hdc" +sdev="ATA:1,0,0" +imagedir="/backup/imgs" + +img=$(ls $imagedir | head -n 1) +echo $img + +if [ -n "$img" ]; then + if cdrecord-wrapper.sh -dao speed=8 dev=$sdev $isoimage; then + md5sum=$(tempfile) + dd if=$dev bs=1M count=4440 | md5sum | awk '{print$1}' > $md5sum + if ! cmp $md5sum $isoimage.md5sum; then + echo "Failed" | mailx -s "DVD md5sum doesn't match image file!!!" $mailto + exit 1 + else + echo $md5sum >> $img.stat + fi + else + echo "Failed" | mailx -s "DVD burning failed!!!" $mailto + exit 1 + fi + + if [ "$(wc -l $img.stat 2>/dev/null)" == "2" ]; then + echo "Burned the image twice. Removing it!" + rm -f $img{,.md5sum,.stat} + rmdir $img.mnt + fi +fi