From 4bfc16f064608fcec50dca085e3e8955282c561d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 14 Jun 2018 15:35:14 -0600 Subject: [PATCH] split servernames and ports strings --- bin/telebitd.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index 8854111..399aa73 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -172,16 +172,20 @@ function serveControls() { if ('undefined' !== typeof conf.telemetry) { state.config.telemetry = conf.telemetry; } - (conf.servernames||[]).forEach(function (key) { - if (!state.config.servernames[key]) { - state.config.servernames[key] = {}; - } - }); - (conf.ports||[]).forEach(function (key) { - if (!state.config.ports[key]) { - state.config.ports[key] = {}; - } - }); + if (conf.servernames) { + (conf.servernames||'').split(/,/g).forEach(function (key) { + if (!state.config.servernames[key]) { + state.config.servernames[key] = {}; + } + }); + } + if (conf.ports) { + (conf.ports||'').split(/,/g).forEach(function (key) { + if (!state.config.ports[key]) { + state.config.ports[key] = {}; + } + }); + } if (!state.config.relay || !state.config.email || !state.config.agreeTos) { res.statusCode = 400;