Skip to content
Snippets Groups Projects
Unverified Commit 64afc892 authored by Nico's avatar Nico
Browse files

add date and beautify HTML

parent 2a2fe405
No related branches found
No related tags found
No related merge requests found
...@@ -9,13 +9,22 @@ echo "$rootdir" ...@@ -9,13 +9,22 @@ echo "$rootdir"
mkdir -p "$rootdir/public/groups" mkdir -p "$rootdir/public/groups"
mkdir -p "$rootdir/public/keys" mkdir -p "$rootdir/public/keys"
echo "<h1>Gruppen</h1>" > public/index.html cat > public/index.html <<EOF
<html>
<head>
<title>Freifunk Stuttgart SSH Keys</title>
<meta charset="utf-8">
</head>
<body>
<h1>Gruppen</<h1>
EOF
for grouppath in "$rootdir/groups/"*; do for grouppath in "$rootdir/groups/"*; do
group=$(basename "$grouppath") group=$(basename "$grouppath")
echo "Group $group" echo "Group $group"
echo "<li><a href=\"groups/$group\">$group</a></li>" >> public/index.html echo "<li><a href=\"groups/$group\">$group</a></li>" >> public/index.html
echo "# Gruppe $group https://pages.freifunk-stuttgart.net/firmware/ssh-keys" > "$rootdir/public/groups/$group" echo "# Gruppe $group https://pages.freifunk-stuttgart.net/firmware/ssh-keys" > "$rootdir/public/groups/$group"
echo "# last generated $(date +'%Y-%b-%d %H:%M:%S')" > "$rootdir/public/groups/$group"
for memberpath in "$rootdir/groups/$group/"*; do for memberpath in "$rootdir/groups/$group/"*; do
member=$(basename "$memberpath") member=$(basename "$memberpath")
echo " Member $member" echo " Member $member"
...@@ -32,10 +41,18 @@ done ...@@ -32,10 +41,18 @@ done
# explicitly unset loop variables to prevent accidental reuse # explicitly unset loop variables to prevent accidental reuse
unset member memberkeyfile memberpath group unset member memberkeyfile memberpath group
echo "<hr>" >> public/index.html
echo "<h1>Nutzer*innen</h1>" >> public/index.html echo "<h1>Nutzer*innen</h1>" >> public/index.html
for keypath in "$rootdir/keys/"*; do for keypath in "$rootdir/keys/"*; do
user=$(basename "$keypath") user=$(basename "$keypath")
echo "<li><a href=\"keys/$user\">$user</a></li>" >> public/index.html echo "<li><a href=\"keys/$user\">$user</a></li>" >> public/index.html
echo "# $user" >> "$rootdir/public/keys/$user" echo "# $user" >> "$rootdir/public/keys/$user"
echo "# last generated $(date +'%Y-%b-%d %H:%M:%S')" > "$rootdir/public/keys/$user"
cat "$rootdir/keys/$user" >> "$rootdir/public/keys/$user" cat "$rootdir/keys/$user" >> "$rootdir/public/keys/$user"
done done
cat >> public/index.html <<EOF
<p>letzte Generierung $(date +'%Y-%b-%d %H:%M:%S')</p>
</body>
</html>
EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment