1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved auto-backup, missing modules recovery.

This commit is contained in:
Ylian Saint-Hilaire 2019-05-17 15:44:01 -07:00
parent 3d465d94b3
commit 89916841cc
4 changed files with 35 additions and 19 deletions

View file

@ -1707,12 +1707,15 @@ process.on('SIGINT', function () { if (meshserver != null) { meshserver.Stop();
// Load the really basic modules
var meshserver = null;
var previouslyInstalledModules = { };
function mainStart(args) {
function mainStart() {
// Check the NodeJS is version 6 or better.
if (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 6) { console.log("MeshCentral requires Node v6.x or above, current version is " + process.version + "."); return; }
// Check for any missing modules.
InstallModules(['minimist'], function () {
// Parse inbound arguments
var args = require('minimist')(process.argv.slice(2));
// Get the server configuration
var config = getConfig(false);
if (config == null) { process.exit(); }
@ -1764,7 +1767,7 @@ function mainStart(args) {
}
if (require.main === module) {
mainStart(require('minimist')(process.argv.slice(2))); // Called directly, launch normally.
mainStart(); // Called directly, launch normally.
} else {
module.exports.mainStart = mainStart; // Required as a module, useful for winservice.js
}