wok-next diff busybox/stuff/busybox-1.18-httpd.u @ rev 10592
mtpfs: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu May 26 12:28:41 2011 +0200 (2011-05-26) |
parents | ab162b37b187 |
children |
line diff
1.1 --- a/busybox/stuff/busybox-1.18-httpd.u Sun Apr 10 14:23:26 2011 +0200 1.2 +++ b/busybox/stuff/busybox-1.18-httpd.u Thu May 26 12:28:41 2011 +0200 1.3 @@ -1,26 +1,20 @@ 1.4 -Httpd already support directory listing: 1.5 - 1.6 -Install /etc/httpd.conf, /var/www/cgi-bin/index.cgi and try ! 1.7 +Httpd already support directory listing. Install both files and try ! 1.8 1.9 ===>8=== /etc/httpd.conf ===>8=== 1.10 H:/var/www 1.11 ===>8=== /var/www/cgi-bin/index.cgi ===>8=== 1.12 #!/bin/sh 1.13 1.14 -path=$QUERY_STRING 1.15 - 1.16 -cat <<EOT 1.17 +[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT 1.18 Content-type: text/html 1.19 1.20 <!DOCTYPE html> 1.21 <html xmlns="http://www.w3.org/1999/xhtml"> 1.22 -<head> 1.23 - <title>Index of $path</title> 1.24 -</head> 1.25 +<head> <title>Index of $QUERY_STRING</title> </head> 1.26 <body> 1.27 - <h1>Index of $path</h1> 1.28 + <h1>Index of $QUERY_STRING</h1> 1.29 <ul> 1.30 -$(cd $PWD/..$path && { [ "$path" != "/" ] && echo "../"; ls -p; } | \ 1.31 +$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \ 1.32 sed 's|.*| <li><a href="&">&</a></li>|') 1.33 </ul> 1.34 </body>