X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=brc2;fp=brc2;h=33384bcdd0a962c90a19242bbcfabf1aa3e4a4c3;hp=5804466f05c8d243edc4f5dca748eef087a857ff;hb=3e5e60efe20de2e109ad48745a5dcee04d7417a1;hpb=d69c535c6bfafa5e6dc0d1be277478a5927790c5 diff --git a/brc2 b/brc2 index 5804466..33384bc 100644 --- a/brc2 +++ b/brc2 @@ -1792,21 +1792,13 @@ bindpush() { dsign iankelling.org expertpathologyreview.com zroe.org amnimal.ninja lipush for h in li bk; do - e sshing $h - ssh $h.b8.nz <<'EOF' -source ~/.bashrc -m dnsup -EOF + m ssh $h.b8.nz dnsup done } bindpushb8() { lipush for h in li bk; do - e sshing $h - ssh $h.b8.nz <<'EOF' -source ~/.bashrc -m dnsb8 -EOF + m ssh $h.b8.nz dnsb8 done } @@ -1817,8 +1809,18 @@ dnsup() { dnsb8() { local f=/var/lib/bind/db.b8.nz m ser stop named - m sleep 1 - m sudo rm -fv $f.jnl $f.signed.jnl + # jbk is like a temp file. dunno if removing it helps + + i=0 + while pgrep '^named$' &>/dev/null; do + sleep .5 + i=$(( i + 1 )) + if (( i > 100 )); then + echo "dnsb8: error: timeout waiting for named to exit" + return 1 + fi + done + m sudo rm -fv $f.jnl $f.signed.jnl $f.jbk m sudo install -m 644 -o bind -g bind /p/c/machine_specific/vps/bind-initial/db.b8.nz $f m ser restart named } @@ -2630,6 +2632,16 @@ wgkey() { umask $umask_orig } +host-info-all() { + host-info-update + bindpushb8 + wrt-setup +} + + +# if you change a host's ip, then run +# bindpushb8 +# wrt-setup host-info-update() { local -A vpn_ips host_ips host_macs nonvpn_ips @@ -2673,8 +2685,6 @@ IdentityFile ~/.ssh/home EOF - grep -E '^[a-z0-9]+[[:space:]]' /p/c/machine_specific/vps/bind-initial/db.b8.nz | awk '{print $1,$3}' - local host ipsuf f files sedi '/edits below here are made automatically/,$d' /p/c/machine_specific/li/filesystem/etc/wireguard/wgmail.conf @@ -2728,7 +2738,7 @@ EOF echo 'local-data-ptr: "$l.'$ipsuf $host.b8.nz'"' done echo "EOF" - } | u /p/ptr-data + } | u /p/c/ptr-data { echo "cat <