X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=index.cgi;h=681c436b867e164fb48cd0017eb94464e6b2215a;hp=f0127826c0eb8f7210d5b7a9d54a0f19e91ca632;hb=d959549ee6cec995f6e8975002b3bc0e9375e564;hpb=8e3f9e69a0f01d1aa0871901ee06ffa90dadc8bc diff --git a/index.cgi b/index.cgi index f012782..681c436 100755 --- a/index.cgi +++ b/index.cgi @@ -7,7 +7,8 @@ die() { } debug() { #change to false to disable debugging #true && echo "$*" >>debug - true && echo "$*" >>/dev/stderr + true && [ -n "$*" ] && echo -E "$*" >>/dev/stderr + true && [ -z "$*" ] && tee /dev/stderr } # this program is supposed to be symlinked into a http root directory @@ -29,7 +30,7 @@ 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 @@ -47,4 +48,6 @@ EOF cgi_get debug "$_GET" -. "$_EXEC/page.sh" +. "$_EXEC/constants.sh" + +[ -n "$_GET[\"action\"]" ] && . "$_EXEC/action.sh" || . "$_EXEC/page.sh"