X-Git-Url: http://git.pippins.net/embedvideo/.git/static/%7Bg-%3Eurl%20arg1=?a=blobdiff_plain;f=scripts%2Fburn-imgs.sh;h=0e1a6bfa139368d2b92dd3c7ca88efbba4517d29;hb=cb3e8792568ba258b606cfe5f30db716f5d3ae4d;hp=a6a5ba9db6ad6fce932bcaa47e0cd3982aa8b750;hpb=f7eab4ae4b364489a6b985c5a1605846a23f4cf1;p=backups%2F.git diff --git a/scripts/burn-imgs.sh b/scripts/burn-imgs.sh index a6a5ba9..0e1a6bf 100755 --- a/scripts/burn-imgs.sh +++ b/scripts/burn-imgs.sh @@ -1,11 +1,12 @@ #!/bin/sh -PATH=/bin:/usr/bin +PATH=$(dirname $0):/bin:/usr/bin -mailto=carl@ecbaldwin.net -dev="/dev/hdc" -sdev="ATA:1,0,0" -imagedir="/backup/imgs" +. config.sh + +# If the noburn file is there then don't burn. +[ -f "$noburnfile" ] && exit 0 +touch $noburnfile # Discover disk images by looking for .img.md5sum files in $imagedir imgmd5=$(ls $imagedir/*.img.md5sum | head -n 1) @@ -26,7 +27,7 @@ img=${imgmd5%.md5sum} # Burn the image to a disk. cdrecord-wrapper.sh -dao dev=$sdev $isoimage > $logfile 2>&1 -if [ 0 != "$?" ]; then +if [ "0" != "$?" ]; then echo >&2 "cdrecord failed!" exit 1 fi @@ -52,7 +53,7 @@ date >> $img.stat cat $img.stat echo cat $logfile -} | mailx -s "DVD burned. File it as ${img%.*}" $mailto > $logfile 2>&1 +} | mailx -s "DVD burned. File as ${img%.*}" $mailto > $logfile 2>&1 # Two lines in the stat file indicate two successful burns. Clean-up the image. if [ "$(wc -l $img.stat 2>/dev/null)" == "2" ]; then