wok-6.x view busybox/stuff/www/cgi-bin/index.cgi @ rev 10899
busybox/httpd: add slitaz style in directory index
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 15 11:50:30 2011 +0200 (2011-07-15) |
parents | 46c3a889a648 |
children | 8e0af5f8e73f |
line source
1 #!/bin/sh
3 [ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT
4 Content-type: text/html
6 <!DOCTYPE html>
7 <html xmlns="http://www.w3.org/1999/xhtml">
8 <head>
9 <title>Index of $QUERY_STRING</title>
10 <meta charset="utf-8" />
11 <link rel="stylesheet" type="text/css" href="../style.css" />
12 </head>
14 <!-- Header -->
15 <div id="header">
16 <h1>Index of $QUERY_STRING</h1>
17 </div>
19 <!-- Content -->
20 <div id="content">
21 <body>
22 <ul>
23 $({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
24 sed 's|.*| <li><a href="&">&</a></li>|')
25 </ul>
26 </div>
28 <!-- Footer -->
29 <div id="footer">
30 Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
31 </div>
33 </body>
34 </html>
35 EOT