From 22a92db58dcdc81dd77c93d27dee491c3c15c87a Mon Sep 17 00:00:00 2001 From: Carl Baldwin Date: Thu, 27 Oct 2005 22:02:51 -0600 Subject: [PATCH] burning script --- scripts/burn-imgs.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/burn-imgs.sh 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 -- 2.34.1