summaryrefslogtreecommitdiffstats
path: root/etc/settings.sh
diff options
context:
space:
mode:
Diffstat (limited to 'etc/settings.sh')
-rw-r--r--etc/settings.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/etc/settings.sh b/etc/settings.sh
new file mode 100644
index 0000000..4116d11
--- /dev/null
+++ b/etc/settings.sh
@@ -0,0 +1,21 @@
+# 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)
+comic_dir=$(pwd)/$(dirname $0)/../../htdocs/imgs/${comic}
+image_offset=${month}/
+image_dir=${comic_dir}/${image_offset}
+
+if [ ! -d "${image_dir}" ]; then
+ mkdir -p "${image_dir}"
+fi
+