pizza1-configs/knot/geodnsupdate

16 lines
410 B
Plaintext
Raw Normal View History

2023-04-16 03:35:37 -07:00
#!/usr/bin/env bash
2024-02-24 11:19:17 +00:00
#remote='cdn@us.vpn.projectsegfau.lt'
remote='cdn@100.64.0.19'
2023-04-16 03:35:37 -07:00
geoconf=/etc/knot/geo.conf
2023-07-30 01:29:04 -07:00
domainsfile=/var/geodnsdomains
restemplate=/configs/knot/geodnstemplate
2023-04-16 03:35:37 -07:00
printf '' > $geoconf
2023-07-30 01:29:04 -07:00
for i in $(<$domainsfile); do
cat $restemplate >> $geoconf
2024-02-24 11:19:17 +00:00
sed -i "s/REPLACEME/${i}/" $geoconf
2023-04-16 03:35:37 -07:00
done
2023-07-30 01:29:04 -07:00
2023-04-16 03:35:37 -07:00
scp $geoconf "${remote}":/var/geo.conf
ssh $remote "sudo systemctl restart knot"
systemctl restart knot