You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
363 B

/etc/init.d/vnstat running || exit 0
[ "$ACTION" = "ifup" ] || exit 0
. /lib/functions.sh
check_iface() {
local iface="$1"
[ "$iface" = "$DEVICE" ] || return
/usr/bin/vnstat --add -i "$iface" >/dev/null
exit 0
}
check_ifaces() {
local cfg="$1"
config_list_foreach "$cfg" interface check_iface
}
config_load vnstat
config_foreach check_ifaces vnstat