Skip to content

Commit

Permalink
v6.29
Browse files Browse the repository at this point in the history
+ 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.
  • Loading branch information
MichaIng authored Jan 21, 2020
1 parent ffc2553 commit 08a78be
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions rootfs/etc/cron.daily/dietpi
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 08a78be

Please sign in to comment.