lots of fixes
[distro-setup] / dynamic-ip-update.sh
index 42dab1f2e67b93055daaa37fc3e83589973adfe8..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.life 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,29 +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.life.*.private <<EOF
+    nsupdate -k /p/c/machine_specific/li/filesystem/etc/bind/Kb8.nz.*.private <<EOF
 server iankelling.org
-zone iank.life
-update delete iank.life. A
-update add iank.life. 300 A $ip
-update delete *.iank.life. A
-update add *.iank.life. 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:
-#mkc /p/c/machine_specific/li/filesystem/etc/bind
-#s dnssec-keygen -a HMAC-MD5 -b 512 -n HOST iank.life
-#s chown ian:ian *
-
-f=key.iank.life
-cat >$f <<EOF
-key iank.life. {
-algorithm HMAC-MD5;
-secret "$(awk '$1 == "Key:" {print $2}' Kiank.life.*.private)";
-};
-EOF
+# # 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 b8.nz
+# s chown $USER:$USER *
+
+# f=key.b8.nz
+# cat >$f <<EOF
+# key b8.nz. {
+# algorithm HMAC-MD5;
+# secret "$(awk '$1 == "Key:" {print $2}' Kb8.nz.*.private)";
+# };
+# EOF
+
+# chmod 640 [kK]*
 
-chmod 640 $f
+# myunison -ob li
+# ssh li conflink
+# ssh li ser restart bind9