fetch_gaidao.sh: Fixed shellcheck warnings.
This commit is contained in:
parent
2a203c0636
commit
44a918d349
|
@ -2,15 +2,15 @@
|
||||||
# Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
|
# Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
|
||||||
|
|
||||||
cd ~/Documents/Zeitungen/Gaidao || exit 1
|
cd ~/Documents/Zeitungen/Gaidao || exit 1
|
||||||
ausgaben="$(curl -s https://fda-ifa.org/gaidao/ausgaben/ \
|
ausgaben=$(curl -s https://fda-ifa.org/gaidao/ausgaben/ \
|
||||||
| grep -Eo 'https://fda-ifa.org/gai-?dao-(n[or]-)?[0-9]+-[^/]*/')"
|
| grep -Eo 'https://fda-ifa.org/gai-?dao-(n[or]-)?[0-9]+-[^/]*/')
|
||||||
|
|
||||||
for ausgabe in ${ausgaben}; do
|
for ausgabe in ${ausgaben}; do
|
||||||
url="$(curl -s ${ausgabe} \
|
url=$(curl -s "${ausgabe}" \
|
||||||
| grep -Eo 'https://fda-ifa.org/wp-content/uploads/[0-9]{4}/[0-9]{2}/[^ ]*\.epub')"
|
| grep -Eo 'https://fda-ifa.org/wp-content/uploads/[0-9]{4}/[0-9]{2}/[^ ]*\.epub')
|
||||||
file="$(echo ${url} | grep -o '[^/]*\.epub')"
|
file=$(echo "${url}" | grep -o '[^/]*\.epub')
|
||||||
if [ ! -e ${file} ]; then
|
if [ ! -e "${file}" ]; then
|
||||||
echo "Downloading Gai Dao: ${file}."
|
echo "Downloading Gai Dao: ${file}."
|
||||||
curl -so ${file} ${url}
|
curl -so "${file}" "${url}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue