for n in "$@"; do case ${n%%=*} in
data) _DATA="${n#data=}";;
exec) _EXEC="${n#exec=}";;
+ base) _BASE="${n#base=}";;
debug) DEBUG="${n#debug=}";;
esac; done
[ ! "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}"
-[ ! "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}"
+[ ! "${_DATA%/}" ] && _DATA="${PWD%/}" || _DATA="${_DATA%/}"
+_BASE="${_BASE%/}"
[ "$DEBUG" ] && exec 2>>"$DEBUG"
-mkdir -p "${_DATA}/cache" "${_DATA}/mappings" "${_DATA}/export" "${_DATA}/lock" "${_DATA}/ical" "${_DATA}/vcard"
+mkdir -p "${_DATA}/cache" "${_DATA}/mappings" "${_DATA}/export" "${_DATA}/lock" "${_DATA}/ical" "${_DATA}/vcard" "${_DATA}/therapies"
. "$_EXEC/cgilite/cgilite.sh"
. "$_EXEC/cgilite/session.sh"
. "$_EXEC/l10n.sh"
_PATH="$(PATH "/${PATH_INFO}")"
+_PATH="${_PATH#${_BASE}}"
ACTION="$(GET a)"
message="$(COOKIE message)"
printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'
{ printf '
[html [head
- [title Lobster]
+ [title Lobster]
[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"]
- '
+ [link rel="stylesheet" type="text/css" href="%s/cgilite/common.css"]
+ [link rel="stylesheet" type="text/css" href="%s/style.css"]
+ ' "${_BASE}" "${_BASE}"
[ -n "$style" ] && printf '
[link rel="stylesheet" type="text/css" href="%s"]
' "$style"
topdir="/${topdir%%/*}"
case ${_PATH} in
- /) REDIRECT /cards/
+ "/") REDIRECT "${_BASE}/cards/"
;;
*)
if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then