Fixes again

This commit is contained in:
Sefinek committed 2025-03-18 22:29:50 +01:00
1 parent f0e797b6c4
commit a292dd5bdf
2 files changed
+6 -4

No files matched your search

+5 -3
View File
@@ -117,13 +117,15 @@ const processLogLine = async (line, test = false) => {
}; };
(async () => { (async () => {
log(0, `v${version} (https://github.com/sefinek/UFW-AbuseIPDB-Reporter)`); log(0, `Version ${version} - https://github.com/sefinek/UFW-AbuseIPDB-Reporter`);
loadReportedIPs(); loadReportedIPs();
log(0, 'Fetching your IP addresses...');
await refreshServerIPs(); await refreshServerIPs();
if (!fs.existsSync(UFW_LOG_FILE)) { if (!fs.existsSync(UFW_LOG_FILE)) {
log(2, `Log file ${UFW_LOG_FILE} does not exist.`); log(2, `Log file ${UFW_LOG_FILE} does not exist`);
return; return;
} }
@@ -134,7 +136,7 @@ const processLogLine = async (line, test = false) => {
const stats = fs.statSync(path); const stats = fs.statSync(path);
if (stats.size < fileOffset) { if (stats.size < fileOffset) {
fileOffset = 0; fileOffset = 0;
log(1, 'The file has been truncated, and the offset has been reset.'); log(1, 'The file has been truncated, and the offset has been reset');
} }
fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' }).on('data', chunk => { fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' }).on('data', chunk => {
+1 -1
Submodule scripts updated: c550075d2d...150fb53fbd.