#!/bin/sh output="/var/www/localhost/htdocs/stats/" nic="eth0" name=$(hostname) generate_index() { cat <<-EOF $name: $nic network statistics
summary
hours
days
months
top10
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