#!/bin/sh set -e GATE=$(hostname) IFACES=$(ls /var/lib/vnstat/) TARGET=/var/www/html/ for iface in $IFACES; do /usr/bin/vnstati -i ${iface} -h -o ${TARGET}${iface}_hourly.png /usr/bin/vnstati -i ${iface} -d -o ${TARGET}${iface}_daily.png /usr/bin/vnstati -i ${iface} -m -o ${TARGET}${iface}_monthly.png /usr/bin/vnstati -i ${iface} -t -o ${TARGET}${iface}_top10.png /usr/bin/vnstati -i ${iface} -s -o ${TARGET}${iface}_summary.png done cat > ${TARGET}index.html < $GATE - Network Traffic EOT for iface in $IFACES; do sed s/IFACE/${iface}/g >> ${TARGET}index.html < traffic summary
traffic per month
traffic per hour
traffic top10
traffic per day EOT done echo "" >> ${TARGET}index.html