switch to for loop
also only now does 5 iterations before giving up
This commit is contained in:
@ -20,8 +20,7 @@ download() {
|
|||||||
[[ -f downloaded_$1.txt ]] || echo -e "${IYELLOW}download_$1.txt doesn't exist${NO_COLOR}" || exit 1
|
[[ -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
|
cp downloaded_$1.txt to_download_$1.txt
|
||||||
|
|
||||||
while [ 1 ]
|
for ((n=0;n<5;n++)); do
|
||||||
do
|
|
||||||
gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt
|
gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt
|
||||||
|
|
||||||
if [ ! -s to_download_$1.txt ]; then
|
if [ ! -s to_download_$1.txt ]; then
|
||||||
@ -38,6 +37,11 @@ download() {
|
|||||||
echo -e "${IGREEN}has internet${NO_COLOR}"
|
echo -e "${IGREEN}has internet${NO_COLOR}"
|
||||||
done
|
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
|
[[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-$1.sqlite3 /data/backup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user