wok-stable annotate 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 |
rev | line source |
---|---|
pascal@10898 | 1 #!/bin/sh |
pascal@10898 | 2 |
pascal@10898 | 3 [ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT |
pascal@10898 | 4 Content-type: text/html |
pascal@10898 | 5 |
pascal@10898 | 6 <!DOCTYPE html> |
pascal@10898 | 7 <html xmlns="http://www.w3.org/1999/xhtml"> |
pascal@10899 | 8 <head> |
pascal@10899 | 9 <title>Index of $QUERY_STRING</title> |
pascal@10899 | 10 <meta charset="utf-8" /> |
pascal@10900 | 11 <link rel="stylesheet" type="text/css" href="/style.css" /> |
pascal@10899 | 12 </head> |
pascal@10899 | 13 |
pascal@10899 | 14 <!-- Header --> |
pascal@10899 | 15 <div id="header"> |
pascal@10899 | 16 <h1>Index of $QUERY_STRING</h1> |
pascal@10899 | 17 </div> |
pascal@10899 | 18 |
pascal@10899 | 19 <!-- Content --> |
pascal@10899 | 20 <div id="content"> |
pascal@10898 | 21 <body> |
pascal@10898 | 22 <ul> |
pascal@10898 | 23 $({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \ |
pascal@10898 | 24 sed 's|.*| <li><a href="&">&</a></li>|') |
pascal@10898 | 25 </ul> |
pascal@10899 | 26 </div> |
pascal@10899 | 27 |
pascal@10899 | 28 <!-- Footer --> |
pascal@10899 | 29 <div id="footer"> |
pascal@10899 | 30 Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a> |
pascal@10899 | 31 </div> |
pascal@10899 | 32 |
pascal@10898 | 33 </body> |
pascal@10898 | 34 </html> |
pascal@10898 | 35 EOT |