From 8e0bf1fb297ba4b5aea80108aa0ff9a2d4634aef Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 11 Nov 2023 11:04:30 -0600 Subject: [PATCH] silent cron Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/svc-cron/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/svc-cron/run b/root/etc/s6-overlay/s6-rc.d/svc-cron/run index e280028..87e4fdb 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-cron/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-cron/run @@ -1,8 +1,8 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash -if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc)" || -n "$(crontab -l -u root)" ]]; then - if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox) =~ [[:space:]](crond)([,]|$) ]]; then +if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc 2>/dev/null || true)" || -n "$(crontab -l -u root 2>/dev/null || true)" ]]; then + if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox || true) =~ [[:space:]](crond)([,]|$) ]]; then exec busybox crond -f -S -l 5 elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then exec /usr/sbin/cron -f -L 5