fix bad dumb bug
[distro-setup] / switch-mail-host
index 4e8dfdece189e4080966d72e18ed5e025bc93c18..ffff83e264dbce8b7e1034d85aea10a055711712 100644 (file)
@@ -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 <<EOF
 for dir in m o; do
-  if mountpoint -q /$dir; then
-    echo On $new_host: umount /$dir
-    umount /$dir
+  if mountpoint -q /\$dir; then
+    echo On $new_host: umount /\$dir
+    umount /\$dir
   fi
 done
 EOF
@@ -241,8 +241,8 @@ EOF
 
 
 e Running initial btrbk
-if ! m btrbk-run -v $bbk_args $incremental_arg $mp_args; then
-  ret=$?
+m btrbk-run -v $bbk_args $incremental_arg $mp_args || ret=$?
+if (( ret )); then
   err "failed initial btrbk"
   exit $ret
 fi
@@ -260,8 +260,8 @@ if $host2_only; then
   exit 0
 fi
 
-if ! m $old_shell /a/exe/primary-setup $new_hostname; then
-  ret=$?
+m $old_shell /a/exe/primary-setup $new_hostname || ret=$?
+if (( ret )); then
   err "failed \$old_shell primary-setup \$new_hostname. fix and rerun $script_name"
   exit $ret
 fi
@@ -291,8 +291,8 @@ echo
 #
 # 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