packages/net/vnstat/files/vnstat.defaults
jow c04fbfede4 vnstat: avoid adding the same interface over and over when running uci-defaults against already existing config
git-svn-id: svn://svn.openwrt.org/openwrt/packages@36716 3c298f89-4303-0410-b956-a3cf2f4a3e73
2013-05-25 12:04:48 +00:00

14 lines
238 B
Bash

#!/bin/sh
wan="$(uci -P/var/state get network.wan.ifname)"
if [ -n "$wan" ]; then
uci -q batch <<-EOF >/dev/null
del_list vnstat.@vnstat[-1].interface=$wan
add_list vnstat.@vnstat[-1].interface=$wan
commit vnstat
EOF
fi
exit 0