From 3c04dbb4edffb203ab40f6aefce905c8dfdc0b7e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 21 Dec 2017 12:33:08 +0100 Subject: [PATCH 1/3] Update remote version at 17:59 as well as on reboot Signed-off-by: DL6ER --- advanced/pihole.cron | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced/pihole.cron b/advanced/pihole.cron index 87a2bd3c..50a9a914 100644 --- a/advanced/pihole.cron +++ b/advanced/pihole.cron @@ -33,4 +33,5 @@ */10 * * * * root PATH="$PATH:/usr/local/bin/" pihole updatechecker local # Pi-hole: Grab remote version every 24 hours -00 00 * * * root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote +59 17 * * * root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote +@reboot root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote From be0c4574450849810cc23c4f809b8a4f442ae6ed Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 21 Dec 2017 12:37:09 +0100 Subject: [PATCH 2/3] Sleep 30 seconds after reboot to be sure that the system is ready Signed-off-by: DL6ER --- advanced/Scripts/updatecheck.sh | 4 ++++ advanced/pihole.cron | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index f8ce59dd..04f210a2 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -39,6 +39,10 @@ git describe --long --dirty --tags || return 1 if [[ "$2" == "remote" ]]; then + if [[ "$3" == "reboot" ]]; then + sleep 30 + fi + GITHUB_CORE_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/pi-hole/releases/latest' 2> /dev/null)")" GITHUB_WEB_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/AdminLTE/releases/latest' 2> /dev/null)")" GITHUB_FTL_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/FTL/releases/latest' 2> /dev/null)")" diff --git a/advanced/pihole.cron b/advanced/pihole.cron index 50a9a914..64837197 100644 --- a/advanced/pihole.cron +++ b/advanced/pihole.cron @@ -34,4 +34,4 @@ # Pi-hole: Grab remote version every 24 hours 59 17 * * * root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote -@reboot root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote +@reboot root PATH="$PATH:/usr/local/bin/" pihole updatechecker remote reboot From f89f7ecd3ea0fd72aa1e403828cfb572b9fcc410 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 21 Dec 2017 12:42:47 +0100 Subject: [PATCH 3/3] Randomize GitHub API update check time Signed-off-by: DL6ER --- automated install/basic-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 527e2d9f..832fd77b 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1368,7 +1368,9 @@ installCron() { # Copy the cron file over from the local repo cp ${PI_HOLE_LOCAL_REPO}/advanced/pihole.cron /etc/cron.d/pihole # Randomize gravity update time - sed -i "s/59 1/$((1 + RANDOM % 58)) $((3 + RANDOM % 2))/" /etc/cron.d/pihole + sed -i "s/59 1 /$((1 + RANDOM % 58)) $((3 + RANDOM % 2))/" /etc/cron.d/pihole + # Randomize update checker time + sed -i "s/59 17/$((1 + RANDOM % 58)) $((12 + RANDOM % 8))/" /etc/cron.d/pihole echo -e "${OVER} ${TICK} ${str}" }