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

  1. /etc/init.d/vnstat running || exit 0
  2. [ "$ACTION" = "ifup" ] || exit 0
  3. . /lib/functions.sh
  4. check_iface() {
  5. local iface="$1"
  6. [ "$iface" = "$DEVICE" ] || return
  7. /usr/bin/vnstat --add -i "$iface" >/dev/null
  8. exit 0
  9. }
  10. check_ifaces() {
  11. local cfg="$1"
  12. config_list_foreach "$cfg" interface check_iface
  13. }
  14. config_load vnstat
  15. config_foreach check_ifaces vnstat