mirror of
https://github.com/openwrt/luci.git
synced 2025-03-16 10:50:27 +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:
@ -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');
|
||||
|
Reference in New Issue
Block a user