summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-05-10 02:11:17 +0000
committerroot <root@vm-staticweb.spline.inf.fu-berlin.de>2012-05-10 02:11:17 +0000
commit29450c99cd8e1d71b139d303a492562e5d4f70ee (patch)
tree12744c5412e54d99edda66990684e87db9046476
parent8fd7f39dfc60fa3bf8d34bb6475939edc795fd66 (diff)
downloadcomics-29450c99cd8e1d71b139d303a492562e5d4f70ee.tar.gz
comics-29450c99cd8e1d71b139d303a492562e5d4f70ee.tar.bz2
comics-29450c99cd8e1d71b139d303a492562e5d4f70ee.zip
bin/comics: check if files are not empty (on error during download)
-rwxr-xr-xbin/comics/calvin2
-rwxr-xr-xbin/comics/claybennett2
-rwxr-xr-xbin/comics/dilbert4
-rwxr-xr-xbin/comics/garfield2
-rwxr-xr-xbin/comics/geekandpoke4
-rwxr-xr-xbin/comics/nichtlustig2
-rwxr-xr-xbin/comics/snoopy2
7 files changed, 9 insertions, 9 deletions
diff --git a/bin/comics/calvin b/bin/comics/calvin
index b611c9f..1cfd0ec 100755
--- a/bin/comics/calvin
+++ b/bin/comics/calvin
@@ -19,7 +19,7 @@ echo
wget ${wget_args} "$nomen" -O "$newn"
-if [ -e "${tmp}/${newn}" ]; then
+if [ -s "${tmp}/${newn}" ]; then
mv "${tmp}/${newn}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.gif"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif"
diff --git a/bin/comics/claybennett b/bin/comics/claybennett
index 5862d1a..9da803b 100755
--- a/bin/comics/claybennett
+++ b/bin/comics/claybennett
@@ -27,7 +27,7 @@ wget ${wget_args} "${img}" -O "${newn}"
echo ${image_dir}
-if [ -e "${tmp}/${newn}" ]; then
+if [ -s "${tmp}/${newn}" ]; then
mv "${tmp}/${newn}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.jpg"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.jpg"
diff --git a/bin/comics/dilbert b/bin/comics/dilbert
index 32689ec..1771658 100755
--- a/bin/comics/dilbert
+++ b/bin/comics/dilbert
@@ -11,7 +11,7 @@ newn="${day}.gif"
wget ${wget_args} --user-agent="$browser" "$webaddress"
-if [ -e index.html ]; then
+if [ -s index.html ]; then
nomen=$(grep -A1 "strips/comic/$(date -d"$daysago days ago" -I)" index.html | \
sed -n 's#.*<img.*src="\(http://[^"]\+\)".*#\1#p' | tail -1)
gifname=$(sed 's#.*/\([^/]\+\)$#\1#' <<< $nomen)
@@ -23,7 +23,7 @@ if [ -e index.html ]; then
echo
wget ${wget_args} --user-agent="$browser" "$nomen"
- if [ -e "${tmp}/${gifname}" ]; then
+ if [ -s "${tmp}/${gifname}" ]; then
mv "${tmp}/${gifname}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.gif"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif"
diff --git a/bin/comics/garfield b/bin/comics/garfield
index 66a05e1..79fd431 100755
--- a/bin/comics/garfield
+++ b/bin/comics/garfield
@@ -19,7 +19,7 @@ echo
wget ${wget_args} "$nomen" -O "$newn"
-if [ -e "${tmp}/${newn}" ]; then
+if [ -s "${tmp}/${newn}" ]; then
mv "${tmp}/${newn}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.gif"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif"
diff --git a/bin/comics/geekandpoke b/bin/comics/geekandpoke
index e25d8e7..d9e46bc 100755
--- a/bin/comics/geekandpoke
+++ b/bin/comics/geekandpoke
@@ -11,7 +11,7 @@ wget ${wget_args} --user-agent="$browser" \
--header="Referer: http://geekandpoke.typepad.com/" \
"http://geekandpoke.typepad.com/" -O index.html
-if [ -e index.html ]; then
+if [ -s index.html ]; then
date="$(LC_ALL=C date +"%B %d, %Y" -d "$daysago days ago")"
nomen="$(grep -A30 "$date" index.html | grep "img class" | head -1 | sed 's/.*img class=[^\/]*src="\([^"]\+\)".*/\1/')"
imgname="$(echo $nomen | tr '/' '\n' | tail -n 1)"
@@ -27,7 +27,7 @@ if [ -e index.html ]; then
wget ${wget_args} --header="Referer: http://geekandpoke.typepad.com/" \
--user-agent="$browser" "$nomen"
- if [ -e "${tmp}/${imgname}" ]; then
+ if [ -s "${tmp}/${imgname}" ]; then
mv "${tmp}/${imgname}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.jpg"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.jpg"
diff --git a/bin/comics/nichtlustig b/bin/comics/nichtlustig
index a3feabd..f8037c4 100755
--- a/bin/comics/nichtlustig
+++ b/bin/comics/nichtlustig
@@ -17,7 +17,7 @@ echo
wget ${wget_args} --header="Referer: http://static.nichtlustig.de/toondb/${date}.html" \
--user-agent="$browser" "$nomen"
-if [ -e "${tmp}/${imgname}" ]; then
+if [ -s "${tmp}/${imgname}" ]; then
mv "${tmp}/${imgname}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.jpg"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.jpg"
diff --git a/bin/comics/snoopy b/bin/comics/snoopy
index 18b6455..9be0c14 100755
--- a/bin/comics/snoopy
+++ b/bin/comics/snoopy
@@ -19,7 +19,7 @@ echo
wget ${wget_args} "$nomen" -O "$newn"
-if [ -e "${tmp}/${newn}" ]; then
+if [ -s "${tmp}/${newn}" ]; then
mv "${tmp}/${newn}" "${image_dir}/$newn"
rm -f "${comic_dir}/latest.gif"
ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif"