#!/bin/sh if [ "$(uci -q get vnstat.@vnstat[-1].interface | grep wan1)" = "" ]; then uci -q batch <<-EOF >/dev/null delete vnstat.@vnstat[-1] add vnstat vnstat set vnstat.@vnstat[-1].interface="wan1" add_list vnstat.@vnstat[-1].interface="wan2" commit vnstat EOF if [ "$(uci -q get network.wan3)" != "" ]; then uci -q batch <<-EOF >/dev/null add_list vnstat.@vnstat[-1].interface="wan3" commit vnstat EOF fi if [ "$(uci -q get network.wan4)" != "" ]; then uci -q batch <<-EOF >/dev/null add_list vnstat.@vnstat[-1].interface="wan4" commit vnstat EOF fi fi rm -f /tmp/luci-indexcache echo '0 */2 * * * /etc/init.d/vnstat_backup backup' > /etc/crontabs/root exit 0