diff --git a/bench/patches/v5/fix_letsencrypt_renew_frequency.py b/bench/patches/v5/fix_letsencrypt_renew_frequency.py index 2c17d98d..61b82111 100644 --- a/bench/patches/v5/fix_letsencrypt_renew_frequency.py +++ b/bench/patches/v5/fix_letsencrypt_renew_frequency.py @@ -7,13 +7,13 @@ def execute(bench_path): This patch fixes a cron job that would renew letsencrypt certificate """ - job_command = '/opt/certbot-auto renew --force-renewal -a nginx --post-hook "systemctl reload nginx"' - system_crontab = CronTab(user='root') - job_comment = "Renew lets-encrypt every month" + job_command = '/opt/certbot-auto renew --force-renewal -a nginx --post-hook "systemctl reload nginx"' + system_crontab = CronTab(user='root') + job_comment = "Renew lets-encrypt every month" - for job in system_crontab.find_comment(job_comment) - system_crontab.remove(job) - job = system_crontab.new(command=job_command, comment=job_comment) - job.setall('0 0 1 * *') # Run at 00:00 on every day-of-month 1 - system_crontab.write() - break + for job in system_crontab.find_comment(job_comment) + system_crontab.remove(job) + job = system_crontab.new(command=job_command, comment=job_comment) + job.setall('0 0 1 * *') # Run at 00:00 on every day-of-month 1 + system_crontab.write() + break