Skip to content

Instantly share code, notes, and snippets.

@EinPinsel
EinPinsel / pihole.sh
Created October 22, 2019 14:43
PiHole HA Setup
#!/bin/bash -x
# README
:'
Credit to redditor /u/jvinch76 https://www.reddit.com/user/jvinch76 for creating the basis for this modification.
I had been thinking of a script like his to keep my primary and secondary pihole raspberry pis in sync, but could not find the motivation to create it.
/u/jvinch76 did the heavy lifting and I made changes I hope you find useful.
I modified the code to increase the frequency of the sync to every 5 minutes and reduce the file writes by using rsync to compare the files and only transfer changes.
Furthermore, gravity will be updated and services restarted only if files are modified and a sync occurs.