pizza1-configs/knot/geodnsupdate

16 lines
410 B
Plaintext
Raw Permalink Normal View History

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