# basic functions
debug() { #change to false to disable debugging
if [ "$DBG_ENABLED" = true -a -n "$*" ]; then
- echo -E "$@" >>"$DBG_FILE"
+ printf '%s\n' "$*" >>"$DBG_FILE"
elif [ "$DBG_ENABLED" = true -a -z "$*" ]; then
tee -a "$DBG_FILE"
elif [ -z "$*" ]; then
}
die() {
- debug "$@"
- echo -E "$@" >>/dev/stderr
+ debug FATAL: "$*"
+ printf '%s\n' "$*" >&2
exit 1
}
[ -x "$_EXEC/constants.sh" ] && . "$_EXEC/constants.sh"
-if [ -n "$_GET[\"action\"]" ]; then
+if [ -n "${_GET[action]}" ]; then
. "$_EXEC/shcgi/action.sh"
else
. "$_EXEC/shcgi/page.sh"