In the meantime, if you've got a passwordless SSH login where you can put the private key within /root/.ssh/
, you can have something like this as a cron job to keep the secondary Pi synced:
Perform maintenance on secondary Pi if online
pi=$(timeout 0.2 ping -c1 192.168.1.2 &> /dev/null && echo "0" || echo "1")
if [ "$pi" -eq 0 ]; then
cd /etc/pihole/
ssh -i /root/.ssh/id.pi "pi@192.168.1.2" "[ ! -f '~/pihole' ] && mkdir ~/pihole"
scp -i /root/.ssh/id.pi adlists.list *list.txt setupVars.conf .domains pi@192.168.1.2:~/pihole
scp -i /root/.ssh/id.pi /etc/dnsmasq.d/03-pihole-wildcard.conf pi@192.168.1.2:~/pihole/03-pihole-wildcard.conf
ssh -i /root/.ssh/id.pi "pi@192.168.1.2" "sudo mv ~/pihole/03-pihole-wildcard.conf /etc/dnsmasq.d; sudo mv ~/pihole/ /etc/pihole"
ssh -i /root/.ssh/id.pi "pi@192.168.1.2" "pihole -g"
fi
Unfortunately, the indenting is broken here