Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Dec 27, 2023
1 parent 8262c7e commit be2223d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sudocleanssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function cmd(str) {
}

const listCertsExpiry = cmd(cmdListCertsExpiry).split('\n')
.slice(5).map(x => x.match(certsExpiryRegexp)).filter(x => x);
.slice(5).map(x => certsExpiryRegexp.exec(x)).filter(x => x);
const listCertsRenewals = cmd(cmdListCertsRenewals).split('\n');

console.log(`Certs currently active: ${listCertsExpiry.length}, domains in active renewal: ${listCertsRenewals.length}`);
Expand All @@ -44,7 +44,7 @@ for (const domain of listCertsRenewals) {
const domainFile = domainFileExp[1];
if (Date.now() - lastIssuedDate < 86400000) {
console.log(`Disabling renewal for ${domain}`);
var c = cat(domainFile).replace('/\nletsencrypt_renew=1/', '');
var c = cat(domainFile).replace(/\nletsencrypt_renew=1/, '');
new ShellString(c).to(domainFile);
count++;
}
Expand Down

0 comments on commit be2223d

Please sign in to comment.