updated ssh script

This commit is contained in:
Radar231 2022-08-11 08:13:34 -04:00
parent 32c77c1ff9
commit 21936bf5e2
1 changed files with 5 additions and 2 deletions

View File

@ -2,12 +2,15 @@
# pihole server to sync from
syncsvr='192.168.7.41'
srcsvr='pihole1'
dstsvr='pihole2'
filepath='/opt/docker/docker_pihole'
# 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')
syncarray=("etc-pihole/custom.list" "etc-dnsmasq.d/05-pihole-custom-cname.conf")
curdate=$(date +%Y%m%d-%H%M%S)
@ -16,7 +19,7 @@ echo "pihole dns sync run: ${curdate}"
for i in "${syncarray[@]}"
do
echo "syncing $i"
scp ${syncusr}@${syncsvr}:${i} ${i}
scp ${syncusr}@${syncsvr}:${filepath}/${srcsvr}/${i} ${filepath}/${dstsvr}/${i}
done
echo "pihole dns sync run completed"