Fixed datapath and filespath settings that did not work.

Ylian Saint-Hilaire committed Oct 28, 2019 at 17:18 UTC 011e0bcc6e56f1948a24e862e19c5ce15f05e084
1 file changed +2 -2
meshcentral.js
+2 -2
@@ -94,8 +94,8 @@ function CreateMeshCentralServer(config, args) {
94 }
95
96 // Look to see if data and/or file path is specified
97 - if (obj.args.datapath) { obj.datapath = obj.args.datapath; }
98 - if (obj.args.filespath) { obj.filespath = obj.args.filespath; }
97 + if (obj.config.settings && (typeof obj.config.settings.datapath == 'string')) { obj.datapath = obj.config.settings.datapath; }
98 + if (obj.config.settings && (typeof obj.config.settings.filespath == 'string')) { obj.filespath = obj.config.settings.filespath; }
99
100 // Create data and files folders if needed
101 try { obj.fs.mkdirSync(obj.datapath); } catch (e) { }