From cc3f0d99c674066df77c737eb46e718cca6fd16d Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Wed, 17 Jul 2024 19:36:42 +0200 Subject: [PATCH] switch to for loop also only now does 5 iterations before giving up --- gallery-dl/gallery-dl.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gallery-dl/gallery-dl.sh b/gallery-dl/gallery-dl.sh index 2c66822..39d468a 100755 --- a/gallery-dl/gallery-dl.sh +++ b/gallery-dl/gallery-dl.sh @@ -20,8 +20,7 @@ download() { [[ -f downloaded_$1.txt ]] || echo -e "${IYELLOW}download_$1.txt doesn't exist${NO_COLOR}" || exit 1 cp downloaded_$1.txt to_download_$1.txt - while [ 1 ] - do + for ((n=0;n<5;n++)); do gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt if [ ! -s to_download_$1.txt ]; then @@ -38,6 +37,11 @@ download() { echo -e "${IGREEN}has internet${NO_COLOR}" done + if [ -s to_download_$1.txt ]; then + # exit with some kind of error + # service should then send error and fitting message to ntfy + fi + [[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-$1.sqlite3 /data/backup }