wok-stable view busybox/stuff/www/cgi-bin/index.cgi @ rev 12089

busybox: tftpd should chroot (thanks Don Manuel)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 10 12:59:12 2012 +0100 (2012-03-10)
parents 491decbaa244
children
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 &copy; $(date +%Y) <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
31 </div>
33 </body>
34 </html>
35 EOT