From b588db91bd0c444f1e000d27394228d183d3fc43 Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Tue, 25 Jun 2024 23:16:00 +0200 Subject: [PATCH] forever till success --- Rule34/gallery-dl.sh | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/Rule34/gallery-dl.sh b/Rule34/gallery-dl.sh index 47ceaa2..0732a52 100755 --- a/Rule34/gallery-dl.sh +++ b/Rule34/gallery-dl.sh @@ -3,29 +3,20 @@ #cd /srv/dev-disk-by-uuid-b7a4d72a-4b42-4599-9712-c044e8fe3213/NSFB/Hentai || exit 1 #cp downloaded_r34.txt to_download_r34.txt || exit 1 -#try once -gallery-dl --config ./config.json --input-file-delete to_download_r34.txt +while [ 1 ] +do + gallery-dl --config ./config.json --input-file-delete to_download_r34.txt -if [ ! -s to_download_r34.txt ]; then - #success! just exit - echo "file empty" - exit 0 -fi + if [ ! -s to_download_r34.txt ]; then + #success! just exit + echo "file empty" + exit 0 + fi + echo "file not empty" -echo "file not empty" -if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then - echo "no internet" - exit 1 -else + if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then + echo "no internet" + exit 1 + fi echo "has internet" -fi - -exit 0 - -#try again -gallery-dl --config ./config.json --input-file-delete to_download_r34.txt - -if [ ! -s to_download_r34.txt ]; then - echo "file empty" - exit 0 -fi +done