mirror of https://github.com/lcpz/lain.git
Fix regression in net.lua widget
The iface argument parsing was logically incorrect and ignoring table argument such as {"eth0", "eth1"}.
This commit is contained in:
parent
272844030a
commit
c8a5a8e502
|
@ -31,7 +31,8 @@ local function worker(args)
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
|
||||||
-- Compatibility with old API where iface was a string corresponding to 1 interface
|
-- Compatibility with old API where iface was a string corresponding to 1 interface
|
||||||
net.iface = (args.iface and type(args.iface) == "string" and {args.iface}) or {}
|
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_device()
|
||||||
helpers.async(string.format("ip link show", device_cmd), function(ws)
|
helpers.async(string.format("ip link show", device_cmd), function(ws)
|
||||||
|
|
Loading…
Reference in New Issue