From: Paul Hänsch Date: Wed, 25 Jul 2018 00:12:59 +0000 (+0200) Subject: accept data and exec dir as arguments X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=df692aadca85504ab0333aa5845e58cac730ad20;p=serve0 accept data and exec dir as arguments --- diff --git a/index.cgi b/index.cgi index 8f21c83..a620cf9 100755 --- a/index.cgi +++ b/index.cgi @@ -1,5 +1,10 @@ #!/bin/sh +for n in "$@"; do case ${n%%=*} in + data) _DATA="${n#data=}";; + exec) _exec="${n#exec=}";; +esac; done + [ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" [ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}"