4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
7 cur
="$(host -4 b8.nz iankelling.org | sed -rn 's/.*has address (.*)/\1/p;T;q')"
8 ip
=$
(curl
-s4 https
://iankelling.org
/cgi
/pubip
)
10 # note, a simpler way to do this would be to ssh and use
12 # to update bind if needed.
14 if [[ $cur != $ip ]]; then
15 nsupdate
-k /p
/c
/machine_specific
/li
/filesystem
/etc
/bind
/Kb8.nz.
*.private
<<EOF
18 update delete b8.nz. A
19 update add b8.nz. 300 A $ip
20 update delete *.b8.nz. A
21 update add *.b8.nz. 300 A $ip
27 # # persistent initial setup for this:
28 # # create files in /a/c/machine_specific/li/filesystem/etc/bind
29 # # note, conflink also does some group ownership stuff.
31 # mkc /p/c/machine_specific/li/filesystem/etc/bind
32 # s dnssec-keygen -a HMAC-MD5 -b 512 -n HOST b8.nz
33 # s chown $USER:$USER *
39 # secret "$(awk '$1 == "Key:" {print $2}' Kb8.nz.*.private)";
47 # ssh li ser restart bind9