#!/bin/bash if [ -z "$1" -o ! -d "$1" ]; then echo "Usage: $0 []" 1>&2 exit 1 fi top="${1}" shift source "${top}/etc/settings.sh" tmp="$(mktemp -d)" cd "${tmp}" browser="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i586)" date="$(date -d"$daysago days ago" +%y%m%d)" imgname="${date}.jpg" nomen="http://static.nichtlustig.de/comics/full/${imgname}" newn="${day}.jpg" echo "Dateiname: $imgname" echo echo "Hole nichtlustig von $nomen" echo "fuer Datum: $(date -d"$daysago days ago" -I)" echo wget ${wget_args} --header="Referer: http://static.nichtlustig.de/toondb/${date}.html" \ --user-agent="$browser" "$nomen" 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" fi rm -rf "${tmp}"