0
0
mirror of https://github.com/openwrt/luci.git synced 2025-03-16 08:30:28 +00:00

luci-proto-3g/ppp/pppossh: fix being unable to set keepalive to 0

Since on openwrt keepalive option defaults to "5 1" when it's not
defined:
6720c4ccba/package/network/services/ppp/files/ppp.sh (L128)

Users must be able to set it to 0 to ignore connection failures.

Signed-off-by: Erdem Gez <perport@perport.net>
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Preport
2024-11-14 23:07:05 +03:00
committed by Paul Donald
parent 4024dfa302
commit f3d26a2a56
6 changed files with 18 additions and 18 deletions
protocols
luci-proto-3g/htdocs/luci-static/resources/protocol
luci-proto-ppp/htdocs/luci-static/resources/protocol
luci-proto-pppossh/htdocs/luci-static/resources/protocol

@ -26,13 +26,13 @@ function write_keepalive(section_id, value) {
f = (f_opt != null) ? +f_opt[0].formvalue(section_id) : null,
i = (i_opt != null) ? +i_opt[0].formvalue(section_id) : null;
if (f == null || f == '' || isNaN(f))
f = 0;
if (f === '' || isNaN(f))
f = null;
if (i == null || i == '' || isNaN(i) || i < 1)
i = 1;
if (f > 0)
if (f !== null)
uci.set('network', section_id, 'keepalive', '%d %d'.format(f, i));
else
uci.unset('network', section_id, 'keepalive');

@ -11,13 +11,13 @@ function write_keepalive(section_id, value) {
f = (f_opt != null) ? +f_opt[0].formvalue(section_id) : null,
i = (i_opt != null) ? +i_opt[0].formvalue(section_id) : null;
if (f == null || f == '' || isNaN(f))
f = 0;
if (f === '' || isNaN(f))
f = null;
if (i == null || i == '' || isNaN(i) || i < 1)
i = 1;
if (f > 0)
if (f !== null)
uci.set('network', section_id, 'keepalive', '%d %d'.format(f, i));
else
uci.unset('network', section_id, 'keepalive');

@ -11,13 +11,13 @@ function write_keepalive(section_id, value) {
f = (f_opt != null) ? +f_opt[0].formvalue(section_id) : null,
i = (i_opt != null) ? +i_opt[0].formvalue(section_id) : null;
if (f == null || f == '' || isNaN(f))
f = 0;
if (f === '' || isNaN(f))
f = null;
if (i == null || i == '' || isNaN(i) || i < 1)
i = 1;
if (f > 0)
if (f !== null)
uci.set('network', section_id, 'keepalive', '%d %d'.format(f, i));
else
uci.unset('network', section_id, 'keepalive');

@ -11,13 +11,13 @@ function write_keepalive(section_id, value) {
f = (f_opt != null) ? +f_opt[0].formvalue(section_id) : null,
i = (i_opt != null) ? +i_opt[0].formvalue(section_id) : null;
if (f == null || f == '' || isNaN(f))
f = 0;
if (f === '' || isNaN(f))
f = null;
if (i == null || i == '' || isNaN(i) || i < 1)
i = 1;
if (f > 0)
if (f !== null)
uci.set('network', section_id, 'keepalive', '%d %d'.format(f, i));
else
uci.unset('network', section_id, 'keepalive');