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 FILTER="$(GET filter)"
15 ORDER="$(GET o |grep -m1 -axE 'firstname|lastname|bdate' || printf firstname)"
16 # LISTSIZE="$(COOKIE pagesize |grep -m1 -axE '[1-9][0-9]*' || printf 50)"
17 ITEM="$(PATH "${PATH_INFO#/}")"; ITEM="${ITEM#/}"
20 if [ -d "${_EXEC}/${ITEM%%/*}" -a -x "${_EXEC}/${ITEM%%/*}/main.cgi" ]; then
21 . "${_EXEC}/${ITEM%%/*}/main.cgi"
22 elif [ "$ITEM" = "style.css" ]; then
23 . "$_EXEC/cgilite/file.sh"
24 [ -r "$_DATA/$ITEM" ] && FILE "$_DATA/$ITEM" \
25 || FILE "$_EXEC/style.css"
26 # elif [ -d "${_EXEC}/${ITEM%%/*}" -a ! -x "${_EXEC}/$ITEM" ]; then
27 # . "$_EXEC/cgilite/file.sh"
28 # FILE "${_EXEC}/$ITEM"
30 printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n'