wpj428/files/usr/sbin/wwan_traffic

14 lines
358 B
Text
Raw Normal View History

2021-03-23 12:38:36 +00:00
#!/usr/bin/lua
local filesize = require "filesize"
local rxfile = io.open("/sys/class/net/wwan0/statistics/rx_bytes", "r")
local txfile = io.open("/sys/class/net/wwan0/statistics/tx_bytes", "r")
local rx = filesize(tonumber(rxfile:read("*all")))
local tx = filesize(tonumber(txfile:read("*all")))
print("RX:", rx, "TX:",tx)
rxfile:close()
txfile:close()