david 821e37cc3f | ||
---|---|---|
LICENSE | ||
README.md | ||
synchole.sh |
README.md
synchole
Shell script to syncronize two or more pi-hole servers. It replicates all changes to blacklist.txt, whitelist.txt, regex.list, /etc/hosts and runs updateGravity
/restartdns
on all members.
Setup
- Login via SSH to the
MASTER
server. - Create symlinks for all files you want to sync within the webroot of the
MASTER
pihole.
cd /var/www/html
sudo mkdir synchole
cd synchole
sudo ln -s /etc/pihole/whitelist.txt .
sudo ln -s /etc/pihole/blacklist.txt .
sudo ln -s /etc/pihole/regex.list .
sudo ln -s /etc/hosts .
- Login via SSH to the
SLAVE
server. - Install synchole on the
SLAVE
server.
cd /opt
sudo git clone https://socialg.it/david/synchole.git
- Configure the synchole script.
sudo vim /opt/synchole.sh
The config section is at the top of the script.
6. Create a cron job for synchole on the SLAVE
server.
sudo crontab -e
Example cronjob: */5 * * * * /opt/synchole/synchole.sh -q
(this runs the synchole every 5 minutes)
7. Setup postfix to send notifications (from cron) on the SLAVE
server.
<placeholder>
- Repeat steps 3 through 5 for additional
SLAVE
servers. - Happy syncholeing!