pizza1-configs/knot/geodnsupdate
2023-06-25 01:21:42 -07:00

12 lines
308 B
Bash
Executable File

#!/usr/bin/env bash
geoconf=/etc/knot/geo.conf
remote='cdn@us'
printf '' > $geoconf
for i in $(</var/geodnsdomains); do
cat /etc/knot/geodnstemplate >> $geoconf
sed -i "s/REPLACEME/${i}/" $geoconf
done
scp $geoconf "${remote}":/var/geo.conf
ssh $remote "sudo systemctl restart knot"
systemctl restart knot