#!/bin/sh dbfile=/var/cache/stats.s3db iface=eth0 time=$(date +%s) rx=$(awk "/$iface/{print int(\$2/125)}" /proc/net/dev) tx=$(awk "/$iface/{print int(\$10/125)}" /proc/net/dev) query= if ! [ -f $dbfile ]; then sqlite3 $dbfile <>/tmp/stat.sql sqlite3 $dbfile "$query"