#!/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