From 08a78becd0c828daf2422b39e01803c04fafc787 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 21 Jan 2020 13:42:05 +0100 Subject: [PATCH] v6.29 + DietPi Cron.Daily | Remove DietPi auto update feature. These should not be applied unattended, due to contained reinstalls and deeper changes by times. Also we often inform/prompt users about changes which might need further manual edits to custom scripts/configs and give choice whether to apply changes, keep or autoremove APT packages not required by DietPi anymore and similar. Unattended APT updates are a different topic which will be implemented instead. + DietPi Cron.Daily | Do not run commands in background. This is a cron job which already runs in background, no need to run the contained processes concurrently. + DietPi Cron.Daily | Redirect STDOUT for all contained commands together. Leave STDERR in place, since such would mean an issue that needs to be investigated. Since most users don't have an MTA configured, those will see "(CRON) info (No MTA installed, discarding output)" only. MAILTO="" should be set by default in crontab to avoid this, with an option to edit in DietPi-Cron. --- rootfs/etc/cron.daily/dietpi | 38 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index 4ce2d6442a..d4f3f31f46 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -13,44 +13,26 @@ #---------------------------------------------------------------- # Main Loop #---------------------------------------------------------------- - # Time sync update, if mode 2 (daily) is detected - if grep -qi '^[[:blank:]]*CONFIG_NTP_MODE=2' /DietPi/dietpi.txt; then - - /DietPi/dietpi/func/run_ntpd 1 &> /dev/null & - - fi + # Sync system time, if mode 2 (daily) is detected + grep -q '^[[:blank:]]*CONFIG_NTP_MODE=2' /DietPi/dietpi.txt && /DietPi/dietpi/func/run_ntpd 1 #---------------------------------------------------------------- - # Check/Update DietPi - if grep -qi '^[[:blank:]]*CONFIG_CHECK_DIETPI_UPDATES=1' /DietPi/dietpi.txt; then - - # - Check and update - if grep -qi '^[[:blank:]]*CONFIG_AUTO_DIETPI_UPDATES=1' /DietPi/dietpi.txt; then - - /DietPi/dietpi/dietpi-update 1 &> /dev/null - - # - Check only - else - - /DietPi/dietpi/dietpi-update 2 &> /dev/null & + # Check for DietPi updates + grep -q '^[[:blank:]]*CONFIG_CHECK_DIETPI_UPDATES=1' /DietPi/dietpi.txt && /DietPi/dietpi/dietpi-update 2 + #---------------------------------------------------------------- + # Refresh DietPi MOTD + if [[ -f '/DietPi/dietpi/.dietpi-banner' ]] && grep -q '^[[:blank:]]*aENABLED\[12\]=1' /DietPi/dietpi/.dietpi-banner; then - fi + curl -sSL https://dietpi.com/motd > /tmp/.dietpi_motd fi #---------------------------------------------------------------- # DietPi-Sync daily if [[ -f '/DietPi/dietpi/.dietpi-sync_settings' ]] && grep -q '^[[:blank:]]*SYNC_CRONDAILY=1' /DietPi/dietpi/.dietpi-sync_settings; then - /DietPi/dietpi/dietpi-sync 1 &> /dev/null & - - fi - #---------------------------------------------------------------- - # Refresh DietPi MOTD - if [[ -f '/DietPi/dietpi/.dietpi-banner' ]] && grep -q '^[[:blank:]]*aENABLED\[12\]=1' /DietPi/dietpi/.dietpi-banner; then - - curl -sL https://dietpi.com/motd > /tmp/.dietpi_motd & + /DietPi/dietpi/dietpi-sync 1 fi #---------------------------------------------------------------- exit #---------------------------------------------------------------- -} +} > /dev/null