pizza1-configs/knot/geodnsupdate
2024-02-24 11:19:17 +00:00

16 lines
410 B
Bash
Executable File

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