wok-6.x annotate busybox/stuff/busybox-1.18-httpd.u @ rev 9552

busybox/httpd: no patch need for directory list
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Apr 10 13:13:17 2011 +0200 (2011-04-10)
parents 3dc7c4a7f5ef
children ab162b37b187
rev   line source
pascal@9552 1 Httpd already support directory listing:
pascal@9535 2
pascal@9552 3 Install /etc/httpd.conf, /var/www/cgi-bin/index.cgi and try !
pascal@9535 4
pascal@9535 5 ===>8=== /etc/httpd.conf ===>8===
pascal@9535 6 H:/var/www
pascal@9552 7 ===>8=== /var/www/cgi-bin/index.cgi ===>8===
pascal@9535 8 #!/bin/sh
pascal@9535 9
pascal@9552 10 path=$QUERY_STRING
pascal@9535 11
pascal@9552 12 cat <<EOT
pascal@9535 13 Content-type: text/html
pascal@9535 14
pascal@9535 15 <!DOCTYPE html>
pascal@9535 16 <html xmlns="http://www.w3.org/1999/xhtml">
pascal@9535 17 <head>
pascal@9535 18 <title>Index of $path</title>
pascal@9535 19 </head>
pascal@9535 20 <body>
pascal@9535 21 <h1>Index of $path</h1>
pascal@9535 22 <ul>
pascal@9552 23 $(cd ${PWD/?index.cgi/}$path && { [ "$path" != "/" ] && echo "../"; ls -p; } | \
pascal@9535 24 sed 's|.*| <li><a href="&">&</a></li>|')
pascal@9535 25 </ul>
pascal@9535 26 </body>
pascal@9535 27 </html>
pascal@9535 28 EOT