diff options
Diffstat (limited to 'vnstat-gen-dir')
-rwxr-xr-x | vnstat-gen-dir | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vnstat-gen-dir b/vnstat-gen-dir new file mode 100755 index 0000000..baa4efe --- /dev/null +++ b/vnstat-gen-dir @@ -0,0 +1,39 @@ +#!/bin/bash + +outputdir="${1:-/tmp}" +outputdir+=/vnstats +: ${IFACES:=wlan0+he6 wlan0 he6} + +mkdir -p "$outputdir" + +cat <<HTML >"$outputdir/index.html" +<!doctype html> +<head> +<meta charset="utf-8"> +<meta name="robots" content="noindex, nofollow"> +<title>vnstati</title> +</head> +<body> +HTML + +for iface in $IFACES; do + base="vnstat-$iface" + for i in s h d t m; do + vnstati -i "$iface" -$i -o "$outputdir/${base}_$i.png" + done +cat <<HTML >>"$outputdir/index.html" +<table border="0"><tr><td> +<img src="${base}_s.png" border="0" alt="summary"></td><td> +<img src="${base}_h.png" border="0" alt="hourly"></td></tr><tr><td valign="top"> +<img src="${base}_d.png" border="0" alt="daily"></td><td valign="top"> +<img src="${base}_t.png" border="0" alt="top 10"><br> +<img src="${base}_m.png" border="0" alt="monthly" vspace="4"></td></tr> +</table> +<hr> +HTML +done + +cat <<HTML >>"$outputdir/index.html" +</body> +</html> +HTML |