pizza1-configs/knot/geodnsupdate

12 lines
308 B
Plaintext
Raw Normal View History

2023-04-16 16:05:37 +05:30
#!/usr/bin/env bash
geoconf=/etc/knot/geo.conf
remote='cdn@us'
2023-04-16 16:05:37 +05:30
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