Don't touch built-in crontabs in RO mode

This commit is contained in:
thespad 2024-06-14 14:02:03 +01:00
parent b68b2644fe
commit 78ab9cc511
No known key found for this signature in database
GPG key ID: 08F06191F4587860

View file

@ -2,9 +2,11 @@
# shellcheck shell=bash # shellcheck shell=bash
for cron_user in abc root; do for cron_user in abc root; do
if [[ -f "/etc/crontabs/${cron_user}" ]]; then if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" if [[ -f "/etc/crontabs/${cron_user}" ]]; then
crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}"
crontab -u "${cron_user}" "/etc/crontabs/${cron_user}"
fi
fi fi
if [[ -f "/defaults/crontabs/${cron_user}" ]]; then if [[ -f "/defaults/crontabs/${cron_user}" ]]; then