From 0775f97b421ea3314af71c576b4b2913dd45ec57 Mon Sep 17 00:00:00 2001 From: Luca CPZ <1777696+lcpz@users.noreply.github.com> Date: Wed, 29 Apr 2020 12:28:39 -0500 Subject: [PATCH] Update net.lua --- widget/net.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/widget/net.lua b/widget/net.lua index 805b577..a6c43ab 100644 --- a/widget/net.lua +++ b/widget/net.lua @@ -29,13 +29,14 @@ local function factory(args) net.iface = (args.iface and (type(args.iface) == "string" and {args.iface}) or (type(args.iface) == "table" and args.iface)) or {} - function net.get_device() + function net.get_devices() + net.iface = {} -- reset at every call helpers.line_callback("ip link", function(line) net.iface[#net.iface + 1] = not string.match(line, "LOOPBACK") and string.match(line, "(%w+): <") or nil end) end - if #net.iface == 0 then net.get_device() end + if #net.iface == 0 then net.get_devices() end function net.update() -- These are the totals over all specified interfaces