Skip to content

Commit

Permalink
fix: Updated command help and verbosity while setting crontab
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Sep 10, 2020
1 parent 87edc4e commit c9abac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bench/commands/utils.py
Expand Up @@ -111,7 +111,7 @@ def download_translations():
download_translations_p()


@click.command('renew-lets-encrypt', help="Renew Let's Encrypt certificate")
@click.command('renew-lets-encrypt', help="Sets Up latest cron and Renew Let's Encrypt certificate")
def renew_lets_encrypt():
from bench.config.lets_encrypt import renew_certs
renew_certs()
Expand Down
2 changes: 2 additions & 0 deletions bench/config/lets_encrypt.py
Expand Up @@ -88,6 +88,8 @@ def run_certbot_and_setup_ssl(site, custom_domain, bench_path, interactive=True)
def setup_crontab():
job_command = '/opt/certbot-auto renew -a nginx --post-hook "systemctl reload nginx"'
job_comment = 'Renew lets-encrypt every month'
print("Setting Up cron job to {0}".format(job_comment))

system_crontab = CronTab(user='root')

for job in system_crontab.find_comment(comment=job_comment): # Removes older entries
Expand Down

0 comments on commit c9abac2

Please sign in to comment.