diff --git a/.gitignore b/.gitignore index 7935536..8f20f09 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ vpn/ accounts/ Microsoft-Rewards-bot/ node_modules/ -.env \ No newline at end of file +.env +batch_logs.json \ No newline at end of file diff --git a/index.js b/index.js index d26aa47..8393c2d 100644 --- a/index.js +++ b/index.js @@ -305,6 +305,11 @@ async function main() { logManager(`[${host}] Log file: batch_logs.json`, 'info'); for (const vpn of vpns) { + const currentDate = new Date(); + const formattedDate = `${currentDate.getDate()}-${currentDate.getMonth() + 1}-${currentDate.getFullYear()}`; + const logEntries = JSON.parse(fs.readFileSync('batch_logs.json', 'utf8')); + const entry = logEntries.find(entries => entries.accountName === vpn); + if (entry && entry.accountName === formattedDate) continue; logManager(`[${host}] Switching to VPN: [${vpn}]`, 'info'); const con = await vpnConnect(vpn); if (con) continue;