# this file is sourced by the get scripts if [ -z "$top" ]; then echo "\$top needs to be set before sourcing settings.sh" 1>&2 exit 1 fi if [ -z "$1" ]; then daysago=0 else daysago=$1 fi 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=${top}/htdocs/imgs/${comic} image_offset=${month}/ image_dir=${comic_dir}/${image_offset} if [ ! -d "${image_dir}" ]; then mkdir -p "${image_dir}" fi wget_args="--timeout 100 --no-cache"