summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-05-10 02:13:27 +0000
committerroot <root@vm-staticweb.spline.inf.fu-berlin.de>2012-05-10 02:13:27 +0000
commitf627125c0fa9fdcc4a0650ab3626330a16e992a8 (patch)
tree9661b56aec83d78d5143696362a1a2115f3705a0 /etc
parent94c28d2746e96fe4414c7d2374910bfac56539b0 (diff)
downloadcomics-f627125c0fa9fdcc4a0650ab3626330a16e992a8.tar.gz
comics-f627125c0fa9fdcc4a0650ab3626330a16e992a8.tar.bz2
comics-f627125c0fa9fdcc4a0650ab3626330a16e992a8.zip
bin/comics: add script for updating xkcd, add $state_file config
xkcd is special (read: other than all others scripts) because it does not contain a timestamp information in the comics. we have to track the last script that was added to our mirror. so the xkcd script needs a state-file containing the last xkcd that was mirrored. the date of the xkcd is the day of the first discovery of a new comic.
Diffstat (limited to 'etc')
-rw-r--r--etc/settings.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/settings.sh b/etc/settings.sh
index d1f5486..d837e7d 100644
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -11,7 +11,11 @@ comic=$(basename $0)
year=$(date -d"$daysago days ago" +%Y)
month=$(date -d"$daysago days ago" +%Y-%m)
day=$(date -d"$daysago days ago" +%d)
-comic_dir=$(pwd)/$(dirname $0)/../../htdocs/imgs/${comic}
+
+top="$(pwd)/$(dirname $0)/../../"
+state_dir=${top}/var/state/
+state_file=${state_dir}/${comic}.state
+comic_dir=${top}/htdocs/imgs/${comic}
image_offset=${month}/
image_dir=${comic_dir}/${image_offset}
@@ -19,4 +23,8 @@ if [ ! -d "${image_dir}" ]; then
mkdir -p "${image_dir}"
fi
+if [ ! -d "${state_dir}" ]; then
+ mkdir -p "${state_dir}"
+fi
+
wget_args="--timeout 100 --wait=1000 --no-cache"