X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=switch-mail-host;h=577d50058570dce5f98219f48a8f37a3a8bf598c;hp=ffb0814b6776e65d0d64366e9c49dd7a5b32e577;hb=b186607514fbcf10bd5664ccb759a6e873f048c7;hpb=9ac513d1086f22a8dede2ebe3ca0236443bdc429 diff --git a/switch-mail-host b/switch-mail-host index ffb0814..577d500 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -146,15 +146,16 @@ elif $host2_only; then mp_args="-m /a,/ar,/q,/qr" fi - -if $host2_only; then - if [[ $old_hostname != "$HOST2" ]]; then - err "\$old_hostname($old_hostname) != \$HOST2($HOST2). Rerun with --force if you really want this." +if ! $force; then + if $host2_only; then + if [[ $old_hostname != "$HOST2" ]]; then + err "\$old_hostname($old_hostname) != \$HOST2($HOST2). Rerun with --force if you really want this." + exit 1 + fi + elif [[ $old_hostname != "$MAIL_HOST" ]]; then + err "\$old_hostname($old_hostname) != \$MAIL_HOST($MAIL_HOST). Rerun with --force if you really want this." exit 1 fi -elif [[ $old_hostname != "$MAIL_HOST" ]] && ! $force; then - err "\$old_hostname($old_hostname) != \$MAIL_HOST($MAIL_HOST). Rerun with --force if you really want this." - exit 1 fi if [[ ! $new_host || ! $old_host ]]; then