split servernames and ports strings

This commit is contained in:
AJ ONeal 2018-06-14 15:35:14 -06:00
parent 2ffdc760a3
commit 4bfc16f064
1 changed files with 14 additions and 10 deletions

View File

@ -172,16 +172,20 @@ function serveControls() {
if ('undefined' !== typeof conf.telemetry) { if ('undefined' !== typeof conf.telemetry) {
state.config.telemetry = conf.telemetry; state.config.telemetry = conf.telemetry;
} }
(conf.servernames||[]).forEach(function (key) { if (conf.servernames) {
(conf.servernames||'').split(/,/g).forEach(function (key) {
if (!state.config.servernames[key]) { if (!state.config.servernames[key]) {
state.config.servernames[key] = {}; state.config.servernames[key] = {};
} }
}); });
(conf.ports||[]).forEach(function (key) { }
if (conf.ports) {
(conf.ports||'').split(/,/g).forEach(function (key) {
if (!state.config.ports[key]) { if (!state.config.ports[key]) {
state.config.ports[key] = {}; state.config.ports[key] = {};
} }
}); });
}
if (!state.config.relay || !state.config.email || !state.config.agreeTos) { if (!state.config.relay || !state.config.email || !state.config.agreeTos) {
res.statusCode = 400; res.statusCode = 400;