]> git.plutz.net Git - lobster/commitdiff
script selection priority
authorPaul Hänsch <paul@plutz.net>
Wed, 8 Jan 2020 00:58:45 +0000 (01:58 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 8 Jan 2020 00:58:45 +0000 (01:58 +0100)
index.cgi

index b52ba72723f7021d10dd66a96dfa20ef137aba63..57de2367ddc95a85850be7ab19b687f52115429a 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -54,15 +54,15 @@ yield_page() {
 topdir="${_PATH#/}"
 topdir="/${topdir%%/*}"
 
-if   [   -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then
-  . "${_EXEC}/${topdir}/index.cgi"
-elif   [   -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then
+if   [   -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then
   . "${_EXEC}/${_PATH}/index.cgi"
 elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then
   . "${_EXEC}/${_PATH}"
 elif [ ! -x "${_EXEC}/${_PATH}" -a -r "${_EXEC}/${_PATH}" ]; then
   . "$_EXEC/cgilite/file.sh"
   FILE "${_EXEC}/${_PATH}"
+elif   [   -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then
+  . "${_EXEC}/${topdir}/index.cgi"
 else
   printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n'
 fi