fix Bug 66211 - Fix issue with SSL renew (#197)

This commit is contained in:
Nasrullo Nurullaev 2024-04-15 15:25:12 +05:00 committed by GitHub
parent 4923756298
commit cf9a4afbdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,11 @@ if ( $args.Count -ge 2 )
$day = (Get-Date -Format "dddd").ToUpper().SubString(0, 3)
$time = Get-Date -Format "HH:mm"
cmd.exe /c "SCHTASKS /F /CREATE /SC WEEKLY /D $day /TN `"Certbot renew`" /TR `"${app}\letsencrypt\letsencrypt_cron.bat`" /ST $time"
$taskName = "Certbot renew"
$action = New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c `"${app}\letsencrypt\letsencrypt_cron.bat`""
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek $day -At $time
Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Force
}
elseif ($args[0] -eq "-d" -or $args[0] -eq "--default") {