update lester

This commit is contained in:
Dessa Simpson 2025-11-26 15:19:27 -07:00
parent da03b88b53
commit 61a0b75bc5
5 changed files with 27 additions and 13 deletions

14
update-lester.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
set -ex
oldip="$(grep -Po '^lester.* \K(\d+\.){3}\d+$' zones/xaviera.systems.zone)"
newip="$(curl -fsS https://ipv4.icanhazip.com)"
[[ "$oldip" = "$newip" ]] && { echo "Nothing to do"; exit; }
for file in $(grep -lr "$oldip"); do
sed -i "s/${oldip}/${newip}/g" "$file"
awk -i inplace '/; serial/{sub(/[0-9]+/, $1+1)} 1' "$file"
done
git diff