From f83f9705e5c2d4c8023b71d85cb01430c043918c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 12 Sep 2021 20:05:07 +0200 Subject: [PATCH 1/1] use argument parsing from cgilite --- index.cgi | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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)" -- 2.39.2