Check for SMTP module and init script on start

This commit is contained in:
Vortrex
2021-02-26 13:49:26 -06:00
parent 463232840c
commit bc549d0a09

View File

@@ -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;
}