Change certbot crontab.

This commit is contained in:
BoHung Chiu 2022-08-24 18:12:55 +08:00
parent d904eed23b
commit d91360dc1a
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ if [ ! -z $certbot_path ]; then
certbot_renew_command=$(sudo -p 'sudo password:' crontab -l|grep "certbot"|grep "renew") certbot_renew_command=$(sudo -p 'sudo password:' crontab -l|grep "certbot"|grep "renew")
if [ -z "$certbot_renew_command" ]; then if [ -z "$certbot_renew_command" ]; then
echo "Add certbot renew cronjob!" echo "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 * * * $certbot_path renew --no-self-upgrade --renew-hook 'sudo service nginx restart' > /var/log/le-renew.log"
echo "$certbot_renew_command" echo "$certbot_renew_command"
CRON="$certbot_renew_command" && (sudo -p 'sudo password:' crontab -l; echo "$CRON" ) | sudo -p 'sudo password:' crontab - CRON="$certbot_renew_command" && (sudo -p 'sudo password:' crontab -l; echo "$CRON" ) | sudo -p 'sudo password:' crontab -
fi fi