Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9704778
html-directories.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
447 B
Referenced Files
None
Subscribers
None
html-directories.sh
View Options
#!/bin/sh
#
# Generates HTML directories listing, similar to nginx autoindex output
#
# Usage: html-directories [directory]
DIR
=
$1
[
-z
"
$DIR
"
]
&&
DIR
=
"."
TITLE
=
"Index of
$DIR
"
echo
"<html>"
echo
"<head><title>
$TITLE
</title></head>"
echo
'<body bgcolor="white">'
echo
"<h1>
$TITLE
</h1><hr>"
echo
'<pre><a href="../">../</a>'
find
$DIR
-type d -depth
1
-exec
echo
"<a href=\"{}\">
$(
basename
"{}"
)
/</a>"
\;
echo
"</pre><hr></body>"
echo
"</html>"
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Jun 14, 07:06 (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2561792
Default Alt Text
html-directories.sh (447 B)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment