Replace crontab file with a printf

This commit is contained in:
2025-12-31 14:02:22 +01:00
parent ecf165ea2e
commit 17cc666f54
2 changed files with 1 additions and 16 deletions

View File

@@ -28,6 +28,7 @@ if [ $1 == 1 ]; then
%{_bindir}/env python3 -m venv /opt/certbot
/opt/certbot/bin/pip install --upgrade pip certbot certbot-dns-ovh
/opt/certbot/bin/certbot certonly --dns-ovh --dns-ovh-credentials "%{_sysconfdir}/certbot/ovh.ini" -d "*.netoik.io" -d "*.samuel-campos.fr"
%{_bindir}/env printf "\nAutomatic certbot renew\n0 12 * * * root sleep $((RANDOM % 3600)) && certbot renew -q\n" >> %{_sysconfdir}/crontab
fi
%{_bindir}/env systemctl enable nginx
%{_bindir}/env systemctl restart nginx