Skip to content

Commit

Permalink
v6.23
Browse files Browse the repository at this point in the history
+ DietPi Cron.Daily | Download new MOTD via cron job, if enabled, to allow faster execution of next banner print
  • Loading branch information
MichaIng authored Apr 30, 2019
1 parent 5245a6c commit 26cffb7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions rootfs/etc/cron.daily/dietpi
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
#----------------------------------------------------------------
# Main Loop
#----------------------------------------------------------------
#Time sync update, if mode 2 (daily) is detected
# 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
#----------------------------------------------------------------
#Check/Update DietPi
# 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
/DietPi/dietpi/dietpi-update 1 &> /dev/null

# - Check only
else
Expand All @@ -37,16 +37,19 @@

fi
#----------------------------------------------------------------
#DietPi-Sync daily
if [[ -f /DietPi/dietpi/.dietpi-sync_settings ]] &&
grep -qi 'SYNC_CRONDAILY=1' /DietPi/dietpi/.dietpi-sync_settings; then
# DietPi-Sync daily
if [[ -f '/DietPi/dietpi/.dietpi-sync_settings' ]] && grep -q 'SYNC_CRONDAILY=1' /DietPi/dietpi/.dietpi-sync_settings; then

/DietPi/dietpi/dietpi-sync 1 &> /dev/null &

fi
#----------------------------------------------------------------
#Clear DietPi motd
[[ -f /tmp/.dietpi_motd ]] && rm /tmp/.dietpi_motd &
# Refresh DietPi MOTD
if [[ -f '/DietPi/dietpi/.dietpi-banner' ]] && grep -q 'aENABLED[12]=1' /DietPi/dietpi/.dietpi-banner; then

curl -sL https://dietpi.com/motd > /tmp/.dietpi_motd &

fi
#----------------------------------------------------------------
exit
#----------------------------------------------------------------
Expand Down

0 comments on commit 26cffb7

Please sign in to comment.