simple pihole dns sync script

initial checkin
This commit is contained in:
Radar231 2021-07-09 09:39:09 -04:00
commit 9b2b1486bb
1 changed files with 25 additions and 0 deletions

25
pihole-dns-sync.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# pihole server to sync from
syncsvr='192.168.7.41'
# user on sync server
syncusr='root'
# declare and populate indexed sync array
syncarray=('/etc/pihole/custom.list' '/etc/dnsmasq.d/05-pihole-custom-cname.conf')
curdate=$(date +%Y%m%d-%H%M%S)
echo ""
echo "pihole dns sync run: ${curdate}"
echo ""
for i in "${syncarray[@]}"
do
scp ${syncusr}@${syncsvr}:${i} ${i}
done
echo ""