Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793474
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
Fri, Feb 28, 21:45 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2435797
Default Alt Text
html-directories.sh (447 B)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment