better alerts
[distro-setup] / switch-mail-host
index 10fcd9f12d82c580e1ee3536c2ac51ed08e9c969..15986953039ea2ae002af37006d2dcb72045adc0 100644 (file)
@@ -26,10 +26,10 @@ restore_new_btrbk=false
 restore_old_btrbk=false
 cleanup() {
   if $restore_new_btrbk; then
-    $new_shell sudo systemctl start btrbk.timer
+    $new_shell sudo systemctl start btrbk.timer
   fi
   if $restore_old_btrbk; then
-    $old_shell sudo systemctl start btrbk.timer
+    $old_shell sudo systemctl start btrbk.timer
   fi
 }
 _errcatch_cleanup=cleanup # used by sourced err
@@ -59,8 +59,8 @@ old_host=$1
 new_host=$2
 source /a/bin/bash_unpublished/source-state
 
-if [[ $old_host != $MAIL_HOST ]]; then
-  read -p "warning: \$old_host != \$MAIL_HOST: $old_host != $MAIL_HOST, proceed? y/N "
+if [[ $old_host != "$MAIL_HOST" ]]; then
+  read -r -p "warning: \$old_host != \$MAIL_HOST: $old_host != $MAIL_HOST, proceed? y/N "
   if [[ $REPLY != [yY] ]]; then
     exit 1
   fi