X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=switch-mail-host;h=edfc30ac827e7a5ca78443c2c23a4ef44b77c792;hb=9a0f77b0495e6f2643d5646c54b4c99cf3118c67;hp=f1cb21272e6a057b41d5e49554b765fc1e98af90;hpb=5a6e794f459b3e83b6d665e05d0ab0c8bc6cdfbe;p=distro-setup diff --git a/switch-mail-host b/switch-mail-host index f1cb212..edfc30a 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -64,7 +64,7 @@ host2_only=false force=false force_arg= pull_reexec=false -mp_args="-m /o,/a,/ar,/q,/qd,/qr" +mp_args="-m /o,/a,/q,/qd,/qr" check_installed=false orig_args=("$@") if ! temp=$(getopt -l check-installed,force,pull-reexec,help afioh "$@"); then @@ -166,7 +166,7 @@ case $direction in /usr/local/{bin/{unsaved-buffers{,.el},switch-mail-host},lib/bash-bear} ) m scp -F $HOME/.ssh/confighome \ - ${files@/#/root@$old_host:} $tmpd + ${files[@]/#/root@$old_host:} $tmpd diff=false for f in ${files[@]}; do if ! diff -q $tmpd/${f##*/} $f; then @@ -214,7 +214,7 @@ esac if $mail_only; then mp_args="-m /o" elif $host2_only; then - mp_args="-m /a,/ar,/q,/qd,/qr" + mp_args="-m /a,/q,/qd,/qr" fi if ! $force; then @@ -344,15 +344,18 @@ fi e Running main btrbk m btrbk-run -v --fast $bbk_args $force_arg $incremental_arg -m /o || ret=$? if (( ret )); then - bang="$(printf "$(tput setaf 5)█$(tput sgr0)%.0s" 1 2 3 4 5 6 7)" + bang="███████" e $bang failed btrbk of /o. restoring old host as primary - m $old_shell /a/exe/primary-setup localhost + if ! m $old_shell /a/exe/primary-setup localhost; then + die due to failed btrbk of /o, we tried to restore old host as primary, but then we failed at that too. To resolve: Fix & rerun switch-mail-host, or fix and rerun primary-setup localhost on old shell so you have a working mail server and then rerun switch-mail-host. + fi + e finished restoring old host as primary, now exiting $ret due to earlier failed btrbk of /o. exit $ret fi # new system is usable at this point blocks=██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ -printf "%s\n" "$(tput setaf 5 2>/dev/null ||:)${blocks:0:${COLUMNS:-180}}$(tput sgr0 2>/dev/null||:)" +printf "%s\n" "${blocks:0:${COLUMNS:-100}}" # once I accidentally accepted incoming mail on old host. I used this script to copy over that mail: #