diff --git a/lego_dl.sh b/lego_dl.sh index 41fec55..61d5c63 100644 --- a/lego_dl.sh +++ b/lego_dl.sh @@ -3,7 +3,7 @@ echo "----> Starting Download of all LEGO instructions from https://brickset.com/exportscripts/instructions" firstline=0 logfile="lego_errors.log" - +downloadFolder="Instructions" #error_level: # 0 no errors reported # 1 Download errors reported @@ -37,7 +37,7 @@ do tADDED=$(sed -e 's/^"//' -e 's/"$//' <<<"$ADDED") tDESC=$(sed -e 's/^"//' -e 's/"$//' <<<"$DESC") filename=$tID"_"${tNAME// /_}"_("${tDESC// /_}")_"$tADDED".pdf" - if [ -f "$filename" ]; then + if [ -f "$downloadFolder/$filename" ]; then echo "-> $tID exists. Skipping..." if [[ $error_level = 2 ]]; then echo "$filename exists." >> $logfile @@ -50,8 +50,8 @@ do fi else echo -ne "--> $tID downloading now..." - curl $tLINK --silent --output $filename - if [ -f "$filename" ]; then + curl $tLINK --silent --output "Instructions/$filename" + if [ -f "$downloadFolder/$filename" ]; then echo "Done!" else echo "ERROR!"