From 17cc666f5416e1eb706733f317ad2e4896ecb8a0 Mon Sep 17 00:00:00 2001 From: samuel Date: Wed, 31 Dec 2025 14:02:22 +0100 Subject: [PATCH] Replace crontab file with a printf --- etc/crontab | 16 ---------------- netoik-rp.spec | 1 + 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 etc/crontab diff --git a/etc/crontab b/etc/crontab deleted file mode 100644 index 5b884bb..0000000 --- a/etc/crontab +++ /dev/null @@ -1,16 +0,0 @@ -SHELL=/bin/bash -PATH=/sbin:/bin:/usr/sbin:/usr/bin -MAILTO=root - -# For details see man 4 crontabs - -# Example of job definition: -# .---------------- minute (0 - 59) -# | .------------- hour (0 - 23) -# | | .---------- day of month (1 - 31) -# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... -# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat -# | | | | | -# * * * * * user-name command to be executed - -0 12 * * * root sleep $((RANDOM % 3600)) && certbot renew -q diff --git a/netoik-rp.spec b/netoik-rp.spec index 37e47c3..03725c2 100644 --- a/netoik-rp.spec +++ b/netoik-rp.spec @@ -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