Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F49508363
html-directories.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
html-directories.sh
View Options
#!/bin/sh
# -------------------------------------------------------------
# HTML directories generator
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Source file: roles/shellserver/userland-software/files/html-directories.sh
# Description: Generates HTML directories listing, similar to nginx autoindex output
# Usage: html-directories [directory]
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
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
Mon, Sep 14, 16:23 (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3993907
Default Alt Text
html-directories.sh (1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment