X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=switch-mail-host;h=ffff83e264dbce8b7e1034d85aea10a055711712;hb=ec17ba8d0cabf1d03f7750406ac687873b12e7f0;hp=4a7ce3744a9cd3e20f81aa087fedf4bef26e927a;hpb=d6def754cd241538c61456536b52ee51cbd85b42;p=distro-setup diff --git a/switch-mail-host b/switch-mail-host index 4a7ce37..ffff83e 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -41,7 +41,7 @@ err-cleanup() { fi } -pre="$script_name:" +pre="${SSH_CLIENT:+$HOSTNAME} $script_name:" m() { printf "$pre %s\n" "$*"; "$@"; } e() { printf "$pre %s\n" "$*"; } err() { echo "$pre ERROR: $*" >&2; } @@ -57,7 +57,7 @@ fi mail_only=false host2_only=false force=false -mp_args="-m /o,/q,/a" +mp_args="-m /o,/a,/ar,/q,/qr" temp=$(getopt -l force,help ioh "$@") || usage 1 eval set -- "$temp" while true; do @@ -204,11 +204,11 @@ if pgrep -G iank -u iank -f 'emacs --daemon' &>/dev/null; then fi EOF if ! $host2_only; then - cat <<'EOF' + cat </dev/null ||:)█$(tput sgr0 2>/dev/null||:)%.0s" $(eval echo "{1..${COLUMNS:-60}}") +echo + # once I accidentally accepted incoming mail on old host. I used this script to copy over that mail: # # die=false; for d in o.leaf.2021-05-29T10:02:08-0400/m/{4e,md,4e2}/{,l/}!(*myarchive)/new; do if $die; then break; fi; find $d -type f -mtime -5 | while read -r f; do dir="${f%new/*}"; dir="btrbk/o.20210530T000011-0400/${dir#*/}"; fname="${f##*/}"; [[ -e $dir/new/$fname || -e $dir/cur/$fname ]] && continue; if ! e cp -a $f /${dir#*/*/}new; then echo failed cp; die=true; break; fi ; done; done @@ -287,8 +291,8 @@ fi # # shopt -s nullglob; find . -type f -mtime -2 | while read -r f; do a=( /m/4e/Sent/cur/${f%,*}* ); if (( ${#a[@]} )); then e exists $a; else m cp -a $f /m/4e/Sent/cur; fi; done -if ! m $new_shell /a/exe/primary-setup localhost; then - ret=$? +m $new_shell /a/exe/primary-setup localhost || ret=$? +if (( ret )); then err "failed final primary-setup, just fix and rerun: $new_shell /a/exe/primary-setup localhost" exit $ret fi