28 lines
639 B
Bash
Executable File
28 lines
639 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
# for testing only
|
|
rm -f ./archive.sqlite3 ./archive-rule34.sqlite3 ./log.txt
|
|
rm -rf ./Download/*
|
|
|
|
[[ -f downloaded_r34.txt ]] || echo "no file to download from" || exit 1
|
|
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"
|
|
rm to_download_r34.txt
|
|
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
|