Last active
July 4, 2023 03:55
-
-
Save totoCZ/45a18acff72ff2b56028037d89f00173 to your computer and use it in GitHub Desktop.
bumps all SOA to trigger update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ts=$(date +%s) | |
FILES="/var/lib/coredns/zones/*" | |
for f in $FILES | |
do | |
echo "Processing $f file..." | |
gawk -i inplace '!/hostmaster.hetmer.net/' $f | |
origin=$(awk 'NR==1{print $1}' $f) | |
sed -i "1s/^/$origin 3600 IN SOA ananas.ns.hetmer.net. hostmaster.hetmer.net. $ts 21600 3600 864000 3600\n/" $f | |
done | |
cd /var/lib/coredns/zones | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --add safe.directory /var/lib/coredns/zones | |
git config user.email "[email protected]" | |
git config user.name "coredns" | |
git add . | |
git commit -m "synced on $(date -I) $(date +%T)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment