1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Merge pull request #1747 from pi-hole/tweak/gravity_update_time

Randomize gravity update time
This commit is contained in:
DL6ER 2017-10-29 16:34:18 +01:00 committed by GitHub
commit 9492ff26c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -14,8 +14,8 @@
# is updated or re-installed. Please make any changes to the appropriate crontab
# or other cron file snippets.
# Pi-hole: Update the ad sources once a week on Sunday at 01:59
# Download any updates from the adlists
# Pi-hole: Update the ad sources once a week on Sunday at a random time in the
# early morning. Download any updates from the adlists
59 1 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updateGravity
# Pi-hole: Update Pi-hole! Uncomment to enable auto update

View File

@ -1356,6 +1356,8 @@ installCron() {
echo -ne " ${INFO} ${str}..."
# 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
echo -e "${OVER} ${TICK} ${str}"
}