From e1413c8bd07f92ec8e1209db83225b56bc39055d Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 25 Apr 2017 00:59:05 -0700 Subject: [PATCH] various updates, add bind --- conflink | 3 ++ distro-begin | 2 ++ distro-end | 3 ++ dynamic-ip-update.sh | 69 ++++++++++++++++++++++++-------------------- guest-apt | 11 +++++++ install-my-scripts | 2 +- myunison | 2 +- 7 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 guest-apt diff --git a/conflink b/conflink index 948d1a2..6a9e4ff 100755 --- a/conflink +++ b/conflink @@ -92,6 +92,9 @@ case $USER in ian) # p needs to go first so .ssh link is created, then config link inside it common-file-setup ${all_dirs[@]} + if [[ -d /etc/bind/bind-writable ]]; then + s chgrp bind /etc/bind/bind-writable + fi sudo -u traci "$BASH_SOURCE" ;; traci) diff --git a/distro-begin b/distro-begin index 71e2a56..9e35654 100755 --- a/distro-begin +++ b/distro-begin @@ -594,6 +594,8 @@ EOF s dd of=/etc/systemd/system/imount.service <<'EOF' [Unit] Description=Mount /i and related mountpoints +RequiredBy=syncthing@ian.service +Before=syncthing@ian.service [Service] Type=oneshot diff --git a/distro-end b/distro-end index e0bf4f6..52d02ff 100755 --- a/distro-end +++ b/distro-end @@ -69,6 +69,7 @@ case $HOSTNAME in aptitude-doc-en bash-doc binutils-doc + bind9-doc bwm-ng chromium cpio-doc @@ -529,6 +530,8 @@ EOF ############# end setup mastodon ############## + pi bind9 + echo "$0: $(date): ending now)" exit 0 ;; diff --git a/dynamic-ip-update.sh b/dynamic-ip-update.sh index a2da871..923da11 100755 --- a/dynamic-ip-update.sh +++ b/dynamic-ip-update.sh @@ -1,32 +1,39 @@ -#!/bin/bash -l - - -# note: in practice, I've not seen my ip address change under comcast -# for over a year. If the internet hadn't mislead me, I wouldn't have -# bothered. - - - - -# based on: https://www.namecheap.com/support/knowledgebase/article.aspx/36/11/how-do-i-start-using-dynamic-dns - -# go to advanced dns, enable the little slider checkbox for dynamic dns, -# add dnynamic dns records for @ and * (not sure * will work, but eh), -# with the initial ip you want. remove any other host records, for example -# the initial default ones. copy the dynamic dns password to /p/dynamic-ip-pass. - -# other articles I found usefull previously, but not the last time -# http://mwholt.blogspot.com/2013/09/how-to-set-up-dynamic-dns-in-5-minutes.html -# https://www.namecheap.com/support/knowledgebase/article.aspx/583/11/how-do-i-configure-ddclient - -ip=`curl -s4 echoip.com` -curl -sS "https://dynamicdns.park-your-domain.com/update?host=@&domain=$HOME_DOMAIN&password=$(cat /p/dynamic-ip-pass)&ip=$ip" > /dev/null - -# an alternative, putting my ip on some known server, -# allows ssh to home if I can access that server: -# ssh -o "ProxyCommand ssh someserver -W desktop:22" desktop - -# ssh root@some_server bash <<'EOF' | log-once dynamic-ip -# sed -i --follow-symlinks '/desktop$/d' /etc/hosts -# echo "${SSH_CLIENT%% *} desktop" >> /etc/hosts +#!/bin/bash + +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')" +ip=$(curl -s4 https://iankelling.org/cgi/pubip) + +# note, a simpler way to do this would be to ssh and use +# "${SSH_CLIENT%% *} +# to update bind if needed. + +if [[ $cur != $ip ]]; then + nsupdate -k /p/c/machine_specific/li/filesystem/etc/bind/Kiank.pw.*.private <$f <