]> git.plutz.net Git - serve0/blobdiff - index.cgi
css loading, externalize page code to file
[serve0] / index.cgi
index 54841bf4338feab6adce565f87d6c71ad34b28b4..94309f3305a50b3690311c0e6a1cbc433fa755b8 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -19,35 +19,31 @@ case $(GET a) in
     SET_COOKIE +$((86400 * 90)) pagesize="$(POST pagesize |grep -m1 -xE '[1-9][0-9]*' || printf 50)"
     SET_COOKIE +$((86400 * 90))  fakemp4="$(POST  fakemp4 |grep -m1 -xE 'yes' || printf no)"
     printf 'Location: %s\r\n\r\n' "$(POST ref)"
+    exit 0
   ;;
 esac
 
-if [ -f "$_DATA/$item" ]; then
+if [ "$item" = "/style.css" ]; then
+  . "$_EXEC/cgilite/file.sh"
+  [ -r "$_DATA/$item" ] && FILE "$_DATA/$item" \
+                        || FILE "$_EXEC/style.css"
+elif [ -f "$_DATA/$item" ]; then
   case $(GET a) in
     tag)
     ;;
-    download)
-    ;;
     thumbnail)
     ;;
     delete)
     ;;
-    *)
+    *) . "$_EXEC/cgilite/file.sh"
+      FILE "$_DATA/$item"
     ;;
   esac
 elif [ -d "$_DATA/$item" ]; then
   case $(GET a) in
     multitag)
     ;;
-    *) printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
-       "$_EXEC/cgilite/html-sh.sed" <<-EOF
-       [!DOCTYPE HTML]
-       [html [head [title Listing]
-       ] [body
-       $(w_search) $(w_prefs)
-       ] ]
-       EOF
-       exit 0
+    *) . "$_EXEC/list.sh"
     ;;
   esac
 else