This commit is contained in:
34
root/defaults/stats
Normal file
34
root/defaults/stats
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/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><td><img src="top10.png" alt="top10"></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 top10 summary hsummary vsummary; do
|
||||
vnstati --${type} -i $nic -o $output/${type}.png
|
||||
done
|
||||
Reference in New Issue
Block a user