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