From 377c34fd05e883b9ee11e58edf2c79e8595b3dc9 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 14 Jul 2023 08:26:14 +0200 Subject: [PATCH] Disable sqm on VPN interface if not download/upload speed --- luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index ba87c23ee..7f3d51ac2 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -552,12 +552,15 @@ function wizard_add() ucic:set("network","omrvpn","proto","bonding") end if downloadmax ~= 0 and uploadmax ~= 0 then + ucic:set("sqm","omrvpn","enabled","1") ucic:set("sqm","omrvpn","max_download",downloadmax) ucic:set("sqm","omrvpn","max_upload",uploadmax) ucic:set("sqm","omrvpn","download",math.ceil(downloadmax*50/100)) ucic:set("sqm","omrvpn","min_download",math.ceil(downloadmax*8/100)) ucic:set("sqm","omrvpn","upload",math.ceil(uploadmax*50/100)) ucic:set("sqm","omrvpn","min_upload",math.ceil(uploadmax*8/100)) + else + ucic:set("sqm","omrvpn","enabled","0") end if vpn_intf ~= "" then ucic:set("network","omrvpn","device",vpn_intf)