From 34a11415d231f2d7505add462f5bb155f5b051a4 Mon Sep 17 00:00:00 2001 From: Andriy Utkin Date: Thu, 10 Oct 2024 23:36:41 +0100 Subject: [PATCH] WIP Deoccupy root's crontab Subdomain TLS certificate renewal jobs have been put to /etc/cron.d/bluecherry. Unobtrusively clear root's crontab from the remaining job entries. --- misc/postinstall.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/postinstall.sh b/misc/postinstall.sh index d1781db0..c3002254 100755 --- a/misc/postinstall.sh +++ b/misc/postinstall.sh @@ -158,6 +158,7 @@ function stop_apache # 1 - rpm install, 2 - rpm upgrade case "$1" in configure|reconfigure|1|2) + PREV_INSTALLED_VERSION=$2 if [[ $IN_DEB ]] then ucfr bluecherry /etc/bluecherry.conf @@ -446,8 +447,10 @@ case "$1" in install_certbot - # Install crontabs for subdomain renewal and SSL renewal using certbot - crontab -l 2>/dev/null || true; printf "* * */5 * * certbot renew --config-dir=/usr/share/bluecherry/nginx-includes/letsencrypt/ >/dev/null 2>&1\n*/5 * * * * curl -k https://localhost:7001/subdomainprovidercron >/dev/null 2>&1\n" | crontab - + # Clean root's crontab from entries which we previously put there + # FIXME one-time upgrade procedure would be nice. + # we have a nice way but use it only for mysql upgrades. + crontab -l 2>/dev/null | grep -v 'bluecherry\|subdomainprovidercron' | crontab - nginx -t 2>/dev/null > /dev/null