From cc8b2827ee5523706915db3006bcc4b315bc1ebd Mon Sep 17 00:00:00 2001 From: Edu4rdSHL Date: Wed, 2 Feb 2022 19:43:37 -0500 Subject: [PATCH] Remove uneeded duplicated code. Signed-off-by: Edu4rdSHL --- script.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script.sh b/script.sh index 1c331e3..7bd41ff 100755 --- a/script.sh +++ b/script.sh @@ -19,11 +19,10 @@ for URL in ${GIVEAWAY_URLS[@]}; do echo "Downloading books now, do not interrupt the process..." COUNTER=0; while read -r LINK; do + COUNTER=$((COUNTER + 1)); if curl -sSfLo "$(basename "$(curl -sSfw '%{redirect_url}' "$LINK")")" "$LINK"; then - COUNTER=$((COUNTER + 1)); echo "Sucessfully downloaded book: $COUNTER/$TOTAL_BOOKS" else - COUNTER=$((COUNTER + 1)); echo "A error as ocurred while downloading the book: $COUNTER from link: $LINK" fi done < links.txt