mostly fixes for new error handling
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 959e892562f485afde4748c71cd66456c23f89ab..df695d2157336734a926e88f940bc0e730b2b1a4 100644 (file)
--- a/brc2
+++ b/brc2
@@ -29,7 +29,6 @@ export WCDHOME=/a
 source /a/bin/distro-functions/src/identify-distros
 source /a/bin/distro-functions/src/package-manager-abstractions
 source /a/bin/log-quiet/logq-function
-source /a/bin/small-misc-bash/psg-function
 # for x in /a/bin/bash_unpublished/source-!(.#*); do echo source $x; done
 source /a/bin/bash_unpublished/source-semi-priv
 source /a/bin/bash_unpublished/source-state
@@ -236,8 +235,9 @@ chrome() {
 
 # do all tee.
 # pipe to this, or just type like a shell
+# todo: test this
 dat() {
-  tee >(ssh frodo.b8.nz bash -l) >(ssh x2 bash -l) >(ssh tp.b8.nz bash -l) >(ssh kw bash -l) >(ssh tp.b8.nz bash -l)
+  tee >(ssh frodo.b8.nz) >(ssh x2) >(ssh tp.b8.nz) >(ssh kw) >(ssh tp.b8.nz)
 }
 da() { # do all
   local host
@@ -867,7 +867,7 @@ spend() {
 
 # By default .bashrc is sourced for ALL ssh commands. This is wonky.
 # Normally, this file is not sourced when a script is run, but we can
-# override that by having #!/bin/bash -l.  I want the same thing for ssh
+# override that by sourcing ~/.bashrc.  I want the same thing for ssh
 # commands. when a local script runs an ssh command, bashrc should not be
 # sourced, unless we use a modified command.
 #
@@ -936,10 +936,13 @@ sl() {
     type=${tmp2: -1}
     if [[ $type == b ]]; then
       info_sec=${tmp::10}
-      if (( $(stat -c%Y /b/ds/brc) > info_sec || $(stat -c%Y /b/ds/.bashrc) > info_sec )); then
-        dorsync=true
-        rm -f $sshinfo
-      fi
+      for f in /b/ds/sl/.iank/*; do
+        if (( $(stat -L -c%Y $f) > info_sec )); then
+          dorsync=true
+          rm -f $sshinfo
+          break
+        fi
+      done
     fi
   else
     dorsync=true
@@ -986,7 +989,7 @@ sl() {
     if [[ -t 0 ]]; then
       BRC=t command ssh "${args[@]}" "$remote" ${@@Q}
     else
-      command ssh "${args[@]}" "$remote" BRC=t bash -l
+      command ssh "${args[@]}" "$remote" BRC=t bash
     fi
   fi
 }