update lester
This commit is contained in:
parent
da03b88b53
commit
61a0b75bc5
5 changed files with 27 additions and 13 deletions
14
update-lester.sh
Executable file
14
update-lester.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue