various fixes and improvements
[distro-setup] / distro-begin
index 1857f61d0c5d1659b71c372e765423d49e191678..ce71c83de81bf5d4b4056ff2d36b469f3cdbfaf1 100755 (executable)
@@ -11,7 +11,7 @@
 # for bootstrapping a new machine
 
 # to make ssh run better, first run this:
-sudo bash -c 'source /a/c/repos/bash/.bashrc && source /a/bin/ssh-emacs-setup'
+sudo bash -c 'source /a/c/repos/bash/.bashrc && source /a/exe/ssh-emacs-setup'
 
 
 # see t.org for OS installer notes
@@ -60,12 +60,12 @@ if [[ $1 ]]; then
     export HOSTNAME=$1
 fi
 
-for f in iank-dev htpc treetowl x2 frodo tp lj lk; do
+for f in iank-dev htpc treetowl x2 frodo tp li lj; do
     eval "$f() { [[ $HOSTNAME == $f ]]; }"
 done
-has_p() { iank-dev || x2 || frodo; }
-has_x() { ! lj && ! lk; }
-encrypted() { has_p || tp; }
+has_p() { iank-dev || x2 || frodo || tp; }
+has_x() { ! { lj || li; }; }
+encrypted() { has_p; }
 
 shopt -s extglob
 export GLOBIGNORE=*/.:*/..
@@ -74,6 +74,7 @@ umask 0002
 
 ####### end command line parsing
 
+PATH="/a/exe:$PATH"
 if encrypted; then
     # I tried making a service which was dependent on reboot.target,
     # but it happened too late in the shutdown process.
@@ -92,7 +93,7 @@ Conflicts=reboot.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/bin/true
-ExecStop=/a/bin/keyscript-on
+ExecStop=/a/exe/keyscript-on
 
 [Install]
 WantedBy=keyscriptoff.service
@@ -108,7 +109,7 @@ Description=Turn off automatic decryption of drives on boot
 
 [Service]
 Type=oneshot
-ExecStart=/a/bin/keyscript-off
+ExecStart=/a/exe/keyscript-off
 
 [Install]
 WantedBy=multi-user.target
@@ -119,7 +120,7 @@ EOF
 fi
 
 
-/a/bin/install-myqueue
+install-myqueue
 
 if iank-dev; then
     desktop=$(ssh root@iankelling.org grep desktop /etc/hosts | grep -o "^.* ")
@@ -139,15 +140,7 @@ fi
 # todo, it would be nice to cut down on some of the output
 
 
-for x in /a/bin/bash-programs-by-ian/repos/{errhandle,tee-unique,lnf}/*-function; do
-    # output is below so shellcheck can verify sources
-    echo "# shellcheck source=$x";
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/bash-trace-function
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errallow-function
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errcatch-function
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errexit-function
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/tee-unique/teeu-function
-    # shellcheck source=/a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+for x in /a/bin/errhandle/*-function; do
     source $x
 done
 
@@ -179,7 +172,7 @@ case $distro in
         sudo bash -c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-ian"
         ;;
     *)
-        sudo bash -c ". /a/bin/fai-wrapper &&
+        sudo bash -c ". /a/bin/fai/fai-wrapper &&
 /a/bin/fai/fai/config/distro-install-common/end"
         ;;
 esac
@@ -202,7 +195,7 @@ lnf-home() {
     done
     lnf ${opts[@]} "$1" /home/ian/$2
     sudo -u traci -i <<EOF
-source /a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+PATH="/a/exe:$PATH"
 lnf ${opts[@]} "$1" /home/traci/$2
 EOF
 }
@@ -210,7 +203,7 @@ EOF
 for x in /a/c/repos/bash/!(.git); do
     lnf-home "$x"
     sudo -i <<EOF
-source /a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+PATH="/a/exe:$PATH"
 lnf $x /root
 EOF
 done
@@ -328,17 +321,18 @@ pi trash-cli
 # todo: reconcile ~/.ssh/config work/home
 s lnf -T /q/p /p
 s lnf -T /a/bin /b
-/a/bin/conflink
+conflink
 
 if has_p; then
     lnf -T /p/offlineimap ~/Maildir
     lnf -T /p/News ~/News
     # don't use /* because I don't want to require it to be mounted
-    s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
-      /a/opt /a/c/.emacs.d /root
 fi
 
-/a/bin/rootsshsync
+s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
+  /a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
+
+rootsshsync
 
 s lnf /a/c/.inputrc /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
 
@@ -616,7 +610,7 @@ fi
 
 # work desktop doesnt need gpg stuff, but it doesnt hurt
 s dd of=/etc/profile.d/environment.sh <<'EOF'
-# IAN: EDIT THIS FROM /a/bin/distro-begin
+# IAN: EDIT THIS FROM /a/bin/distro-setup/distro-begin
 
 if [ -f $HOME/path_add-function ]; then
     . $HOME/path_add-function
@@ -680,7 +674,7 @@ EOF
 
 
 
-/a/bin/postfix-setup
+postfix-setup
 
 if isubuntu; then
     # disable crash report annoying crap