4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
7 cur
="$(host -4 iank.pw 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
/Kiank.pw.
*.private
<<EOF
18 update delete iank.pw. A
19 update add iank.pw. 300 A $ip
20 update delete *.iank.pw. A
21 update add *.iank.pw. 300 A $ip
27 # persistent initial setup for this:
28 # mkc /p/c/machine_specific/li/filesystem/etc/bind
29 # s dnssec-keygen -a HMAC-MD5 -b 512 -n HOST iank.pw
36 # secret "$(awk '$1 == "Key:" {print $2}' Kiank.pw.*.private)";