You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
578 B
36 lines
578 B
2 years ago
|
#!/usr/bin/env sh
|
||
|
INPUT=/usr/share/nginx/html/
|
||
|
OUTPUT=/usr/share/nginx/html/index.html
|
||
|
|
||
|
HTML_TOP=$(cat << EOF
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Code#0 documentation</title>
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
<style>
|
||
|
body {
|
||
|
margin: 0px;
|
||
|
}
|
||
|
</style>
|
||
|
<body>
|
||
|
<h5>Page updated every 5 minute.</h5>
|
||
|
<ul>
|
||
|
EOF
|
||
|
)
|
||
|
|
||
|
HTML_BOTTOM=$(cat << EOF
|
||
|
</ul>
|
||
|
</body>
|
||
|
</html>
|
||
|
EOF
|
||
|
)
|
||
|
|
||
|
echo $HTML_TOP > $OUTPUT
|
||
|
|
||
|
cd $INPUT
|
||
|
for d in */ ; do
|
||
|
echo "<li><a href=\"$d\">"$d"</a></li>" >> $OUTPUT
|
||
|
done
|
||
|
|
||
|
echo $HTML_BOTTOM >> $OUTPUT
|