summaryrefslogtreecommitdiffstats
path: root/etc/settings.sh
blob: d07293fa69604cdb38fcf42aa21c9eb8a6d43c1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# this file is sourced by the get scripts

if [ "$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)

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}

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 --random-wait --no-cache"