fix syntax and format
All checks were successful
/ release-and-build (push) Successful in 36s

This commit is contained in:
Pi-Farm
2026-02-24 23:25:21 +01:00
parent 937489e56f
commit 49cf27b3d6

View File

@@ -4,31 +4,31 @@ output="/app/www/.stats"
nic="eth0" nic="eth0"
generate_index() { generate_index() {
cat <<-EOF cat <<EOF
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="cache-control" content=no-cache"> <meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="refresh" content="3000"> <meta http-equiv="refresh" content="3000">
<title>Alpine Linux mirror statistics</title> <title>Alpine Linux mirror statistics</title>
</head> </head>
<body> <body>
<table border="0"> <table border="0">
<tr><td><img src="summary.png" alt="summary"></td><td><img src="hours.png" alt="hours"></td></tr> <tr><td><img src="summary.png" alt="summary"></td><td><img src="hours.png" alt="hours"></td></tr>
<tr><td rowspan="2"><img src="days.png" alt="days"></td></tr> <tr><td rowspan="2"><img src="days.png" alt="days"></td></tr>
<tr><td><img src="months.png" alt="months"></td></tr> <tr><td><img src="months.png" alt="months"></td></tr>
</table> </table>
</body> </body>
</html> </html>
EOF EOF
} }
if [ ! -f "$output"/index.html ]; then if [ ! -f "$output/index.html" ]; then
mkdir -p $output mkdir -p "$output"
generate_index > "$output"/index.html generate_index > "$output/index.html"
fi fi
for type in hours days months summary hsummary vsummary; do for type in hours days months summary hsummary vsummary; do
vnstati --${type} -i $nic -o $output/${type}.png vnstati --${type} -i "$nic" -o "$output/${type}.png"
done done