lots of fixes
[distro-setup] / dynamic-ip-update.sh
index 923da11464a95fbbbbcdf96493baa88510e38022..336aaf3583e16b42e527832d67ad1e414a45ac24 100755 (executable)
@@ -4,7 +4,7 @@ set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
 
-cur="$(host -4 iank.pw iankelling.org | sed -rn 's/.*has address (.*)/\1/p;T;q')"
+cur="$(host -4 b8.nz iankelling.org | sed -rn 's/.*has address (.*)/\1/p;T;q')"
 ip=$(curl -s4 https://iankelling.org/cgi/pubip)
 
 # note, a simpler way to do this would be to ssh and use
@@ -12,28 +12,36 @@ ip=$(curl -s4 https://iankelling.org/cgi/pubip)
 # to update bind if needed.
 
 if [[ $cur != $ip ]]; then
-    nsupdate -k /p/c/machine_specific/li/filesystem/etc/bind/Kiank.pw.*.private <<EOF
+    nsupdate -k /p/c/machine_specific/li/filesystem/etc/bind/Kb8.nz.*.private <<EOF
 server iankelling.org
-zone iank.pw
-update delete iank.pw. A
-update add iank.pw. 300 A $ip
-update delete *.iank.pw. A
-update add *.iank.pw. 300 A $ip
+zone b8.nz
+update delete b8.nz. A
+update add b8.nz. 300 A $ip
+update delete *.b8.nz. A
+update add *.b8.nz. 300 A $ip
 show
 send
 EOF
 fi
 
-# persistent initial setup for this:
+# # persistent initial setup for this:
+# # create files in /a/c/machine_specific/li/filesystem/etc/bind
+# # note, conflink also does some group ownership stuff.
+
 # mkc /p/c/machine_specific/li/filesystem/etc/bind
-# s dnssec-keygen -a HMAC-MD5 -b 512 -n HOST iank.pw
-# s chown ian:ian *
+# s dnssec-keygen -a HMAC-MD5 -b 512 -n HOST b8.nz
+# s chown $USER:$USER *
 
-# f=key.iank.pw
+# f=key.b8.nz
 # cat >$f <<EOF
-# key iank.pw. {
+# key b8.nz. {
 # algorithm HMAC-MD5;
-# secret "$(awk '$1 == "Key:" {print $2}' Kiank.pw.*.private)";
+# secret "$(awk '$1 == "Key:" {print $2}' Kb8.nz.*.private)";
 # };
 # EOF
-# chmod 640 $f
+
+# chmod 640 [kK]*
+
+# myunison -ob li
+# ssh li conflink
+# ssh li ser restart bind9