3 for n in "$@"; do case ${n%%=*} in
4 data) _DATA="${n#data=}";;
5 exec) _exec="${n#exec=}";;
9 [ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}"
10 [ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}"
12 . "$_EXEC/cgilite/cgilite.sh"
14 _PATH="$(PATH "/${PATH_INFO}")"
18 local class="$1" style="$2"
19 printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'
22 [meta name="viewport" content="width=device-width"]
23 [link rel="stylesheet" type="text/css" href="/style.css"]
25 [ -n "$style" ] && printf '
26 [link rel="stylesheet" type="text/css" href="%s"]
34 | "${_EXEC}/cgilite/html-sh.sed"
37 if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/main.cgi" ]; then
38 . "${_EXEC}/${_PATH}/main.cgi"
39 elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then
41 elif [ ! -x "${_EXEC}/${_PATH}" -a -r "${_EXEC}/${_PATH}" ]; then
42 . "$_EXEC/cgilite/file.sh"
43 FILE "${_EXEC}/${_PATH}"
45 printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n'