diff --git a/scripts/generate-keys.sh b/scripts/generate-keys.sh index 90258e70c09e8d572a16f4cd5528938c2575b32d..ab95ced89b88542177bb65fee7cfc4dc83ceae6d 100755 --- a/scripts/generate-keys.sh +++ b/scripts/generate-keys.sh @@ -9,13 +9,22 @@ echo "$rootdir" mkdir -p "$rootdir/public/groups" 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 group=$(basename "$grouppath") echo "Group $group" 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 "# last generated $(date +'%Y-%b-%d %H:%M:%S')" > "$rootdir/public/groups/$group" for memberpath in "$rootdir/groups/$group/"*; do member=$(basename "$memberpath") echo " Member $member" @@ -32,10 +41,18 @@ done # explicitly unset loop variables to prevent accidental reuse unset member memberkeyfile memberpath group +echo "<hr>" >> public/index.html echo "<h1>Nutzer*innen</h1>" >> public/index.html for keypath in "$rootdir/keys/"*; do user=$(basename "$keypath") echo "<li><a href=\"keys/$user\">$user</a></li>" >> public/index.html 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" done + +cat >> public/index.html <<EOF +<p>letzte Generierung $(date +'%Y-%b-%d %H:%M:%S')</p> +</body> +</html> +EOF