-local wanif = uci.inst_state:get("network", "wan", "ifname")
-local wanul, wandl
-
-if wanif then
- local devstats = fs.readfile("/proc/net/dev")
- local rx, tx = devstats:match("%s*"..wanif..
- ":%s*([0-9]+)%s+[0-9]+%s+[0-9]+%s+[0-9]+%s+"..
- "[0-9]+%s+[0-9]+%s+[0-9]+%s+[0-9]+%s+([0-9]+)")
- wanul = tx and (tonumber(tx) / 1000000000)
- wandl = rx and (tonumber(rx) / 1000000000)
-end