Skip to content

Commit

Permalink
Clean ssl fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Oct 19, 2024
1 parent 03c50f6 commit 25d06de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sudocleanssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ for (const domain of listCertsRenewals) {
if (lastIssuedDateExp && domainFileExp) {
const lastIssuedDate = Date.parse(lastIssuedDateExp[1]);
const domainFile = domainFileExp[1];
if (Date.now() - lastIssuedDate > 86400000) {
const deltaHour = Math.trunc(Date.now() - lastIssuedDate / (3600000));
if (deltaHour > 24) {
if (test) {
console.log('TEST: This domain will be validated: ' + domain);
console.log(`TEST: Will check ${domain} due to last issue ${deltaHour} hours`);
continue;
}
console.log(`Disabling renewal for ${domain}`);
Expand All @@ -58,7 +59,7 @@ for (const domain of listCertsRenewals) {
count++;
} else {
if (test) {
console.log(`TEST: Skipping ${domain} due to last issue ${Date.now() - lastIssuedDate / (86400000)} days`);
console.log(`TEST: Skipping ${domain} due to last issue ${deltaHour} hours`);
}
}
}
Expand Down

0 comments on commit 25d06de

Please sign in to comment.