david/synchole
david
/
synchole
Archived
1
0
Fork 0
Shell script to syncronize a secondary pi-hole server with a primary pi-hole server. It downloads blacklist.txt, whitelist.txt and regex.list from the primary, updates local files and runs updateGravity on the secondary.
This repository has been archived on 2023-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
david c540bc595b refinded a bit more and updated README.md 2019-11-09 01:01:52 +01:00
LICENSE Add LICENSE 2019-10-29 22:23:12 +00:00
README.md refinded a bit more and updated README.md 2019-11-09 01:01:52 +01:00
synchole.sh refinded a bit more and updated README.md 2019-11-09 01:01:52 +01:00

README.md

synchole

Shell script to syncronize a SLAVE pi-hole server with a MASTER pi-hole server. It downloads blacklist.txt, whitelist.txt and regex.list from the MASTER, updates local files and runs updateGravity on the SLAVE.

Setup

  1. Login via SSH to the MASTER server.

  2. Create symlinks for all files you want to be able 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 .
  1. Login via SSH to the SLAVE server.

  2. Install wget and synchole on the SLAVE server.

sudo apt-get update
sudo apt-get install wget
sudo wget https://socialg.it/david/synchole/raw/master/synchole.sh -O /usr/bin/synchole.sh
sudo chmod +x /usr/bin/synchole.sh
  1. Configure the synchole script to your liking.
sudo vim /opt/synchole.sh

The config section is at the top of the script.

  1. Create a cron job for synchole on the SLAVE server.
sudo crontab -e

Example cronjob: */5 * * * * /opt/synchole/synchole.sh -q (this runs synchole every 5 minutes)

  1. Repeat steps 3 through 6 for additional SLAVE servers.

  2. Happy syncholeing!

Resources