Fix bug.
This commit is contained in:
parent
436275bce0
commit
e5a00f7fcb
|
@ -44,7 +44,7 @@ namespace :create_site do
|
||||||
certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0]
|
certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0]
|
||||||
unless certbot_renew_command
|
unless certbot_renew_command
|
||||||
update_thread_infos("Add certbot renew cronjob!")
|
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)
|
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)
|
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
|
end
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace :create_site do
|
||||||
certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0]
|
certbot_renew_command = crontab_lines.select{|l| l.include?("certbot") && l.include?("renew")}[0]
|
||||||
unless certbot_renew_command
|
unless certbot_renew_command
|
||||||
update_thread_infos("Add certbot renew cronjob!")
|
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)
|
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)
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue