Check for SMTP module and init script on start
This commit is contained in:
@@ -13,6 +13,7 @@ function initServerScripts() {
|
|||||||
checkForAllRequiredModules();
|
checkForAllRequiredModules();
|
||||||
initDatabaseScript();
|
initDatabaseScript();
|
||||||
initConfigScript();
|
initConfigScript();
|
||||||
|
initEmailScript();
|
||||||
initClassScript();
|
initClassScript();
|
||||||
initBitFlagScript();
|
initBitFlagScript();
|
||||||
initBusinessScript();
|
initBusinessScript();
|
||||||
@@ -62,6 +63,16 @@ function checkForMySQLModule() {
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function checkForSMTPModule() {
|
||||||
|
if(typeof module.smtp == "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function checkForAllRequiredModules() {
|
function checkForAllRequiredModules() {
|
||||||
logToConsole(LOG_DEBUG, "[Asshat.Startup]: Checking for required modules ...");
|
logToConsole(LOG_DEBUG, "[Asshat.Startup]: Checking for required modules ...");
|
||||||
|
|
||||||
@@ -77,6 +88,12 @@ function checkForAllRequiredModules() {
|
|||||||
thisResource.stop();
|
thisResource.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!checkForSMTPModule()) {
|
||||||
|
console.warn("[Asshat.Startup]: SMTP Email module is not loaded!");
|
||||||
|
console.warn("[Asshat.Startup]: This resource will now shutdown.");
|
||||||
|
thisResource.stop();
|
||||||
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, "[Asshat.Startup]: All required modules loaded!");
|
logToConsole(LOG_DEBUG, "[Asshat.Startup]: All required modules loaded!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user