I can't be bothered
This commit is contained in:
@ -1,10 +1,14 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
IGREEN="\033[0;92m" # Intense Green
|
||||||
|
IYELLOW="\033[0;93m" # Intense Yellow
|
||||||
|
NO_COLOR="\033[0m" # Text Reset
|
||||||
|
|
||||||
# for testing only
|
# for testing only
|
||||||
rm -f ./archive.sqlite3 ./archive-rule34.sqlite3 ./log.txt
|
rm -f ./archive.sqlite3 ./archive-rule34.sqlite3 ./log.txt
|
||||||
rm -rf ./Download/*
|
rm -rf ./Download/*
|
||||||
|
|
||||||
[[ -f downloaded_r34.txt ]] || echo "no file to download from" || exit 1
|
[[ -f downloaded_r34.txt ]] || echo -e "${IYELLOW}no file to download from${NO_COLOR}" || exit 1
|
||||||
cp downloaded_r34.txt to_download_r34.txt
|
cp downloaded_r34.txt to_download_r34.txt
|
||||||
|
|
||||||
while [ 1 ]
|
while [ 1 ]
|
||||||
@ -12,16 +16,15 @@ do
|
|||||||
gallery-dl --config ./config.json --input-file-delete to_download_r34.txt
|
gallery-dl --config ./config.json --input-file-delete to_download_r34.txt
|
||||||
|
|
||||||
if [ ! -s to_download_r34.txt ]; then
|
if [ ! -s to_download_r34.txt ]; then
|
||||||
#success! just exit
|
echo -e "${IGREEN}file empty${NO_COLOR}"
|
||||||
echo "file empty"
|
|
||||||
rm to_download_r34.txt
|
rm to_download_r34.txt
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "file not empty"
|
echo -e "${IYELLOW}file not empty${NO_COLOR}"
|
||||||
|
|
||||||
if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then
|
if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then
|
||||||
echo "no internet"
|
echo -e "${IYELLOW}no internet${NO_COLOR}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "has internet"
|
echo -e "${IGREEN}has internet${NO_COLOR}"
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user