diff --git a/lib/tasks/detect_sites.rake b/lib/tasks/detect_sites.rake index 9a4a0f5..86249c6 100644 --- a/lib/tasks/detect_sites.rake +++ b/lib/tasks/detect_sites.rake @@ -44,7 +44,7 @@ namespace :create_site do certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0] unless certbot_renew_command update_thread_infos("Add certbot renew cronjob!") - certbot_renew_command = "30 2 * * 1 #{certbot_path} renew --no-self-upgrade --post-hook 'sudo service nginx restart' > /var/log/le-renew.log" + certbot_renew_command = "30 2 * * 1 #{certbot_path} renew --nginx-ctl /usr/sbin/nginx --no-self-upgrade --post-hook 'sudo service nginx restart' > /var/log/le-renew.log" update_thread_infos(certbot_renew_command) exec_ssh_command_by_sudo_and_see_output(ssh,"CRON=\"#{certbot_renew_command}\" && (sudo -p 'sudo password:' crontab -l; echo \"\$CRON\" ) | sudo -p 'sudo password:' crontab -",false) end diff --git a/lib/tasks/install_certbot.rake b/lib/tasks/install_certbot.rake index 4675472..a7dc9b3 100644 --- a/lib/tasks/install_certbot.rake +++ b/lib/tasks/install_certbot.rake @@ -92,7 +92,7 @@ namespace :create_site do certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0] unless certbot_renew_command update_thread_infos("Add certbot renew cronjob!") - certbot_renew_command = "30 2 * * 1 #{certbot_path} renew --no-self-upgrade --post-hook 'sudo service nginx restart' > /var/log/le-renew.log" + certbot_renew_command = "30 2 * * 1 #{certbot_path} renew --nginx-ctl /usr/sbin/nginx --no-self-upgrade --post-hook 'sudo service nginx restart' > /var/log/le-renew.log" update_thread_infos(certbot_renew_command) exec_ssh_command_by_sudo_and_see_output(ssh,"CRON=\"#{certbot_renew_command}\" && (sudo -p 'sudo password:' crontab -l; echo \"\$CRON\" ) | sudo -p 'sudo password:' crontab -",false) end