lots of fixes, automation for bitfolk
[distro-setup] / distro-begin
index e2d1a8713dbef07c58956d681244aa565d86463b..84900fe1de71587a385f4e65a8ed774ddaffcd78 100755 (executable)
@@ -236,12 +236,13 @@ sudo sed -i --follow-symlinks -f - /etc/hosts <<EOF
 /^127\.0\.1\.1/d
 EOF
 
-if bitfolk; then
-  sudo systemctl disable systemd-networkd
-fi
-
 ##### exit first stage if running as root
 if [[ $EUID == 0 ]]; then
+  if [[ ! -e /home/iank/.ssh/authorized_keys && ! -L /home/iank/.ssh/authorized_keys ]]; then
+    sudo -u iank mkdir -p /home/iank/.ssh
+    chmod 0700 /home/iank/.ssh
+    sudo -u iank ln -sf /p/c/machine_specific/vps/subdir_files/.ssh/authorized_keys /home/iank/.ssh
+  fi
   echo "$0: running as root. exiting now that users are setup"
   exit 0
 fi
@@ -317,6 +318,11 @@ fi
 case $HOSTNAME in
   bk)
     sudo sed -i --follow-symlinks 's/^ *hosts:.*/hosts: files dns myhostname/' /etc/nsswitch.conf
+    soff systemd-resolved
+    ln -sf 127.0.0.1-resolv/stub-resolv.conf /etc/resolv.conf
+    sgo bind9
+    # cautious measure to make sure bind is up
+    sleep 1
     ;;
   *)
     # default is
@@ -602,7 +608,9 @@ EOF
     ;;
 esac
 
-
+if bitfolk; then
+  sudo systemctl disable systemd-networkd
+fi
 
 ##### setup email
 primary-setup