1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Fix sysctl settings

This commit is contained in:
Ycarus 2018-06-13 08:36:20 +02:00
parent a3abdd34e4
commit e5c14c7a23
2 changed files with 4 additions and 4 deletions

View file

@ -202,12 +202,12 @@ function settings_add()
-- Set tcp_keepalive_time
local tcp_keepalive_time = luci.http.formvalue("tcp_keepalive_time")
luci.sys.exec("sysctl -w net.ipv4.tcp_keepalive_time=%s" % tcp_keepalive_time)
luci.sys.exec("sed -i 's:^net.ipv4.tcp_keepalive_time = [0-9]*:net.ipv4.tcp_keepalive_time=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_keepalive_time)
luci.sys.exec("sed -i 's:^net.ipv4.tcp_keepalive_time=[0-9]*:net.ipv4.tcp_keepalive_time=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_keepalive_time)
-- Disable IPv6
local disable_ipv6 = luci.http.formvalue("disable_ipv6") or 0
luci.sys.exec("sysctl -w net.ipv6.conf.all.disable_ipv6=%s" % disable_ipv6)
luci.sys.exec("sed -i 's:^net.ipv6.conf.all.disable_ipv6 = [0-9]*:net.ipv6.conf.all.disable_ipv6=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % disable_ipv6)
luci.sys.exec("sed -i 's:^net.ipv6.conf.all.disable_ipv6=[0-9]*:net.ipv6.conf.all.disable_ipv6=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % disable_ipv6)
ucic:set("firewall",ucic:get_first("firewall","defaults"),"disable_ipv6",disable_ipv6)
ucic:save("firewall")
ucic:commit("firewall")

View file

@ -1,2 +1,2 @@
net.ipv4.tcp_keepalive_time = 1200
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv4.tcp_keepalive_time=1200
net.ipv6.conf.all.disable_ipv6=0