Files
Pi-Farm 49cf27b3d6
All checks were successful
/ release-and-build (push) Successful in 36s
fix syntax and format
2026-02-24 23:25:21 +01:00

34 lines
839 B
Bash
Executable File

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