1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Disable sqm on VPN interface if not download/upload speed

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-07-14 08:26:14 +02:00
parent 099c6cd947
commit 377c34fd05

View file

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