#!/usr/bin/bash cp downloaded_r34.txt 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 echo "file not empty" if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then echo "no internet" exit 1 fi echo "has internet" done