From: Paul Hänsch Date: Sun, 12 Sep 2021 18:05:07 +0000 (+0200) Subject: use argument parsing from cgilite X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=f83f9705e5c2d4c8023b71d85cb01430c043918c;p=serve0 use argument parsing from cgilite --- diff --git a/index.cgi b/index.cgi index 1b84d2f..f625199 100755 --- a/index.cgi +++ b/index.cgi @@ -1,18 +1,9 @@ #!/bin/sh exec 2>/dev/null -for n in "$@"; do case ${n%%=*} in - data) _DATA="${n#data=}";; - exec) _exec="${n#exec=}";; - noerr) exec 2>&-;; -esac; done - -[ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" -[ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}" - file_pattern='^.*\.(mov|ts|mpg|mpeg|mp4|m4v|avi|mkv|flv|sfv|wmv|ogm|ogv|webm|iso|rmvb)$' -. "$_EXEC/cgilite/cgilite.sh" +. "${_EXEC:-${0%/*}}/cgilite/cgilite.sh" FILTER="$(GET f)" SEARCH="$(GET s)"