linux - fix cron jobs

This commit is contained in:
bunkerity
2021-08-18 16:15:26 +02:00
parent 0938b20eb8
commit fd52bb7c8d
3 changed files with 14 additions and 7 deletions

View File

@@ -886,14 +886,14 @@ do_and_check_cmd chmod 770 /var/lib/letsencrypt
# Install cron
echo "[*] Add jobs to crontab"
if [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] ; then
CRON_PATH="/var/spool/cron/crontabs/nginx"
elif [ "$OS" = "centos" ] || [ "$OS" = "fedora" ] ; then
CRON_PATH="/var/spool/cron/nginx"
elif [ "$OS" = "alpine" ] ; then
if [ "$OS" = "alpine" ] ; then
CRON_SRC="/tmp/bunkerized-nginx/misc/cron"
CRON_PATH="/etc/crontabs/nginx"
else
CRON_SRC="/tmp/bunkerized-nginx/misc/cron-linux"
CRON_PATH="/etc/cron.d/nginx"
fi
do_and_check_cmd cp /tmp/bunkerized-nginx/misc/cron "$CRON_PATH"
do_and_check_cmd cp "$CRON_SRC" "$CRON_PATH"
do_and_check_cmd chown root:nginx "$CRON_PATH"
do_and_check_cmd chmod 740 "$CRON_PATH"