X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=index.cgi;h=1c4e7175ddf83f25dae4d7dc84ef7dd125734433;hp=07edbf2bb25244cc15c1aac9f4e9b7653ae1c47c;hb=670da503edafe7206002ccf2c469285ee8f61bda;hpb=e7627a0ae248718b53aebe9e61b7c66b7f65b82e diff --git a/index.cgi b/index.cgi index 07edbf2..1c4e717 100755 --- a/index.cgi +++ b/index.cgi @@ -3,11 +3,14 @@ for n in "$@"; do case ${n%%=*} in data) _DATA="${n#data=}";; exec) _EXEC="${n#exec=}";; - noerr) exec 2>&-;; + debug) DEBUG="${n#debug=}";; esac; done -[ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" -[ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}" +[ ! "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" +[ ! "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}" +[ "$DEBUG" ] && exec 2>>"$DEBUG" + +mkdir -p "${_DATA}/cache" "${_DATA}/mappings" "${_DATA}/export" "${_DATA}/lock" "${_DATA}/ical" "${_DATA}/vcard" debug() { local dbg=/dev/stderr @@ -49,6 +52,7 @@ yield_page() { [html [head [title Confetti] [meta name="viewport" content="width=device-width"] + [link rel="stylesheet" type="text/css" href="/cgilite/common.css"] [link rel="stylesheet" type="text/css" href="/style.css"] ' [ -n "$style" ] && printf '