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:
Renato F 2017-01-24 00:14:02 -02:00 committed by GitHub
parent 272844030a
commit c8a5a8e502
1 changed files with 2 additions and 1 deletions

View File

@ -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)