}
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
[ -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
cgi_get
debug "$_GET"
-. "$_EXEC/page.sh"
+. "$_EXEC/constants.sh"
+
+[ -n "$_GET[\"action\"]" ] && . "$_EXEC/action.sh" || . "$_EXEC/page.sh"