X-Git-Url: http://git.plutz.net/?p=serve0;a=blobdiff_plain;f=index.cgi;h=94309f3305a50b3690311c0e6a1cbc433fa755b8;hp=54841bf4338feab6adce565f87d6c71ad34b28b4;hb=10c72cceebb66db98ad621181369edfa6294f924;hpb=10597e4506dca6e0f4abe239ff44e742d3de8a8c diff --git a/index.cgi b/index.cgi index 54841bf..94309f3 100755 --- 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