X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=index.cgi;h=6bd36d5fbdecd916dccc949fd11ea293abe0798b;hp=327135f8f21529e9cb029bba29b530e3a22a5ad8;hb=91b5294e622198de6d3efaa2bb1ad9c7c3cfe1a7;hpb=2dc9740e1452127d64d027b57432032242f04eff diff --git a/index.cgi b/index.cgi index 327135f..6bd36d5 100755 --- a/index.cgi +++ b/index.cgi @@ -7,7 +7,7 @@ die() { } debug() { #change to false to disable debugging #true && echo "$*" >>debug - true && [ -n "$*" ] && echo "$*" >>/dev/stderr + true && [ -n "$*" ] && echo -E "$*" >>/dev/stderr true && [ -z "$*" ] && tee /dev/stderr } @@ -24,13 +24,10 @@ done _EXEC="$(dirname "$real")" #execution directory _DATA="$(dirname "$call")" #storage directory -debug "Execution dir: $_EXEC" -debug "Storage dir: $_DATA" - [ -w "$_DATA" ] && [ -d "$_DATA" ] || die "storage directory must be writable" # create directories for object storage -for each in "$_DATA"/{vcard,mappings,courses}; do +for each in "$_DATA"/{vcard,mappings,courses,cache,temp}; do [ ! -e "$each" ] && mkdir "$each" [ -w "$each" ] && [ -d "$each" ] || die "storage $each must be a writable directory" done @@ -46,6 +43,7 @@ EOF . "$_EXEC/cgi.sh" cgi_get -debug "$_GET" -. "$_EXEC/page.sh" +. "$_EXEC/constants.sh" + +[ -n "$_GET[\"action\"]" ] && . "$_EXEC/action.sh" || . "$_EXEC/page.sh"