lots of fixes
[distro-setup] / dynamic-ip-update.sh
index e339f7c24ccaa04951b77326a8a109d85f7ebe0a..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,17 +12,6 @@ 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
-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
-show
-send
-EOF
-
     nsupdate -k /p/c/machine_specific/li/filesystem/etc/bind/Kb8.nz.*.private <<EOF
 server iankelling.org
 zone b8.nz
@@ -37,10 +26,11 @@ fi
 
 # # 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 iank:iank *
+# s chown $USER:$USER *
 
 # f=key.b8.nz
 # cat >$f <<EOF
@@ -50,7 +40,7 @@ fi
 # };
 # EOF
 
-# chmod 640 $f
+# chmod 640 [kK]*
 
 # myunison -ob li
 # ssh li conflink