From 709881566a6f39d6c6d999eb424abbd405683499 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Tue, 23 Jun 2020 15:09:56 +0200 Subject: [PATCH] Added download folder location --- lego_dl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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!"