diff --git a/index.js b/index.js index 769b546..25b172a 100644 --- a/index.js +++ b/index.js @@ -139,14 +139,14 @@ const processLogLine = async line => { }); }); - if (process?.send) process.send('ready'); + // Auto updates + if (AUTO_UPDATE_ENABLED && AUTO_UPDATE_SCHEDULE) await require('./services/updates.js')(); + if (DISCORD_WEBHOOKS_ENABLED && DISCORD_WEBHOOKS_URL) await require('./services/summaries.js')(); + + await discordWebhooks(0, `[UFW-AbuseIPDB-Reporter](https://github.com/sefinek/UFW-AbuseIPDB-Reporter) has been successfully launched on the device \`${SERVER_ID}\`.`); log(0, `Ready! Now monitoring: ${UFW_LOG_FILE}`); log(0, '====================================================================='); - await discordWebhooks(0, `[UFW-AbuseIPDB-Reporter](https://github.com/sefinek/UFW-AbuseIPDB-Reporter) has been successfully launched on the device \`${SERVER_ID}\`.`); - - // Auto updates - if (AUTO_UPDATE_ENABLED && AUTO_UPDATE_SCHEDULE) await require('./services/updates.js')(); - if (DISCORD_WEBHOOKS_ENABLED && DISCORD_WEBHOOKS_URL) await require('./services/summaries.js')(); + process.send && process.send('ready'); })(); \ No newline at end of file diff --git a/services/summaries.js b/services/summaries.js index 501a07e..ea89035 100644 --- a/services/summaries.js +++ b/services/summaries.js @@ -68,6 +68,6 @@ const sendWebhook = async () => { }; module.exports = async () => { - await sendWebhook(); + // await sendWebhook(); new CronJob('0 0 * * *', sendWebhook, null, true, 'UTC'); -}; +}; \ No newline at end of file diff --git a/services/updates.js b/services/updates.js index 42980cb..9100109 100644 --- a/services/updates.js +++ b/services/updates.js @@ -10,7 +10,7 @@ const git = simpleGit(); const pull = async () => { await discordWebhooks(4, 'Updating the local repository in progress `(git pull)`...'); - log(0, '$ git pull'); + log(0, 'Running git pull...'); try { const { summary } = await git.pull();