14 lines
358 B
Text
14 lines
358 B
Text
|
#!/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()
|