better output
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index fd7fcafb6670fec4f7516d6356ca4e30ffad7774..fb14eaa76a854fda26146cf4f356126078620606 100644 (file)
--- a/brc2
+++ b/brc2
@@ -118,22 +118,28 @@ bpush() {
   switch-mail-host $HOSTNAME $1 | pee cat "systemd-cat -t switch-mail-host"
 }
 lipush() {
-  rsync $@ --delete-excluded -ahviSAXPH --specials --devices --delete --relative \
-        --exclude-from=/p/c/li-rsync-excludes /a/bin /a/exe /a/h /a/c /p/c/machine_specific/li /a/opt/{emacs,emacs-debianstable,mu} root@li:/
-}
-lipushnoe() {
+  # note, i had --delete-excluded, but that deletes all files in --exclude-from on
+  # the remote site, which doesn't make sense, so not sure why i had it.
+  local p a
+  p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/linode{,.hosts} /a/opt/{emacs,emacs-debianstable,mu})
+  a="-ahviSAXPH --specials --devices --delete --relative --exclude-from=/p/c/li-rsync-excludes"
+  rsync $@ $a ${p[@]} root@l2.b8.nz:/
+  rsync $@ $a ${p[@]} /p/c/machine_specific/li root@iankelling.org:/
+  rsync $@ -ahviSAXPH root@iankelling.org:/a/h/proposed-comments/ /a/h/proposed-comments
+}
+lipushnoe() { # noe = noemacs. for running faster.
   rsync $@ --delete-excluded -ahviSAXPH --specials --devices --delete --relative \
         --exclude-from=/p/c/li-rsync-excludes /a/bin /a/exe /a/h /a/c /p/c/machine_specific/li  root@li:/
 }
 
 
+#### begin bitcoin related things
 btc() {
   local f=/etc/bitcoin/bitcoin.conf
   # importprivkey will timeout if using the default of 15 mins.
   # upped it to 1 hour.
   bitcoin-cli -rpcclienttimeout=60000 -$(s grep rpcuser= $f) -$(s grep rpcpassword= $f) "$@"
 }
-
 btcusd() { # $1 btc in usd
   local price
   price="$(curl -s https://api.coinbase.com/v2/prices/BTC-USD/spot | jq -r .data.amount)"
@@ -160,6 +166,7 @@ satoshi() { # $1 satoshi in usd
     printf "$%.2f\n" "$(echo "scale=10; $price * $1"| bc -l)"
   fi
 }
+#### end bitcoin related things
 
 
 
@@ -227,7 +234,26 @@ debian_pick_mirror () {
   sudo apt-get update
 }
 
-
+dup() {
+  local ran_d
+  ran_d=false
+  case $PS1 in
+    *DISTRO-BEGIN*)
+      /b/ds/distro-begin || return $?
+      ran_d=true
+      ;;&
+    *DISTRO-END*)
+      /b/ds/distro-end || return $?
+      ran_d=true
+      ;;&
+    *CONFLINK*)
+      if ! $ran_d; then
+        conflink
+      fi
+      ;;
+  esac
+  system-status _
+}
 
 envload() { # load environment from a previous: export > file
   local file=${1:-$HOME/.${USER}_env}
@@ -817,13 +843,15 @@ sl() {
     info_date=${tmp::11}
     type=${info_date: -1}
     info_date=${info_date::10}
+    info_sec=$(date -d @$info_date +%s)
     # debug
     #e $(( $(stat -c%Y /b/ds/brc) - $(date -d @$info_date +%s) ))
-    if (( $(stat -c%Y /b/ds/brc) > $(date -d @$info_date +%s) )); then
+    if (( $(stat -c%Y /b/ds/brc) > info_sec || $(stat -c%Y /b/ds/.bashrc) > info_sec )); then
       old=true
     fi
   else
-    tmp=$(command ssh -t "${args[@]}" "$remote" "if test -e /p/sshinfo; then echo yes; fi") || return
+    # use this weird yes thing to ensure we know ssh succeeded
+    tmp=$(command ssh "${args[@]}" "$remote" "if test -e /p/sshinfo; then echo yes; fi") || return
     if [[ $tmp == yes ]]; then
       type=a
     else
@@ -920,11 +948,16 @@ testexim() {
   # note, for exim daemon, you can turn on debug options by
   # adding -d, etc to COMMONOPTIONS in
   # /etc/default/exim4
-  #  exim -d -t <<'EOF'
-  exim -i 'test@zroe.org, t2@zroe.org'  <<'EOF'
-From: ian@iankelling.org
-To: test@zroe.org, t2@zroe.org
-Subject: Testing Exim
+  #
+  # to specify recipients other than those in to, cc, bcc, you can use the cli args, eg:
+  #  exim -i 'test@zroe.org, t2@zroe.org'  <<'EOF'
+  #
+  #
+  exim -d -t <<'EOF'
+From: i@dmarctest.b8.nz
+To: mailman@dev.fsf.org
+Subject: test2
+Reply-to: rtest@iankelling.org
 
 This is a test message.
 EOF