#!/bin/sh output="/app/www/.stats" nic="eth0" generate_index() { cat <<-EOF Alpine Linux mirror statistics
summaryhours
days
months
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