From c23834fefafa7ea4e3ba67839e9bbc38dbaa0889 Mon Sep 17 00:00:00 2001 From: CLN <7887972+cln-io@users.noreply.github.com> Date: Sun, 19 Mar 2023 11:57:21 +0100 Subject: [PATCH] Updates cron job file to work with /crond and /cron (#519) newer versions don't have /crond anymore, so we check if crond is there if so restart it. if crond is not there we check for cron and restart cron if its present fixes #515 --- .../examples/udm-files/on_boot.d/25-add-cron-jobs.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/on-boot-script/examples/udm-files/on_boot.d/25-add-cron-jobs.sh b/on-boot-script/examples/udm-files/on_boot.d/25-add-cron-jobs.sh index 7995730..c944500 100644 --- a/on-boot-script/examples/udm-files/on_boot.d/25-add-cron-jobs.sh +++ b/on-boot-script/examples/udm-files/on_boot.d/25-add-cron-jobs.sh @@ -20,6 +20,13 @@ esac ## This script will re-add them on startup. cp ${DATA_DIR}/cronjobs/* /etc/cron.d/ -/etc/init.d/crond restart +# Older UDM's had crond, so lets check if its here if so use that one, otherwise use cron +if [ -x /etc/init.d/crond ]; then + /etc/init.d/crond restart +elif [ -x /etc/init.d/cron ]; then + /etc/init.d/cron restart +else + echo "Neither crond nor cron found." +fi exit 0