uspot: correctly honor "debug=0" configs

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
Thibaut VARÈNE
2023-05-12 10:22:15 +02:00
committed by John Crispin
parent b7f8c7e788
commit d667c2e2b9
3 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ function syslog(interface, mac, msg) {
}
function debug(interface, mac, msg) {
if (config[interface].debug)
if (+config[interface].debug)
syslog(interface, mac, msg);
}

View File

@@ -90,7 +90,7 @@ return {
},
debug: function(ctx, msg) {
if (config.def_captive.debug)
if (+config.def_captive.debug)
this.syslog(ctx, msg);
},

View File

@@ -6,7 +6,7 @@ let uci = require('uci').cursor();
let config = uci.get_all('uspot');
global.handle_request = function(env) {
if (env.REMOTE_ADDR && config.def_captive.debug)
if (env.REMOTE_ADDR && +config.def_captive.debug)
warn('uspot: ' + env.REMOTE_ADDR + ' - CPD redirect\n');
include('cpd.uc', { env });
};