From c8e77cca25b6485362ea6a21ab0ac11a83b361e3 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 30 Oct 2020 19:29:27 +0100 Subject: [PATCH] Fix adding interface via wizard --- .../luasrc/controller/openmptcprouter.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 4d5e73e4b..1bb28c3b1 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -93,7 +93,9 @@ function wizard_add() ucic:foreach("network", "interface", function(s) local sectionname = s[".name"] if sectionname:match("^wan(%d+)$") then - i = tonumber(string.match(sectionname, '(%d+)$')) + 1 + if i <= tonumber(string.match(sectionname, '%d+')) then + i = tonumber(string.match(sectionname, '%d+')) + 1 + end end if ucic:get("network",sectionname,"multipath") == "master" then multipath_master = true