From: Paul Hänsch Date: Sat, 23 Jan 2021 13:25:22 +0000 (+0100) Subject: config flag for debug output X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=67242ede9efbdee9eaec4483cb882efc680c8c78;p=confetti config flag for debug output --- diff --git a/index.cgi b/index.cgi index ae9ac2a..ee0d6f7 100755 --- a/index.cgi +++ b/index.cgi @@ -3,11 +3,12 @@ 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"