mirror of
https://github.com/edu4rdshl/microsoft-giveaway-books.git
synced 2026-07-17 23:24:53 +00:00
Remove uneeded duplicated code.
Signed-off-by: Edu4rdSHL <edu4rdshl@protonmail.com>
This commit is contained in:
parent
4ff4cc5454
commit
cc8b2827ee
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue