X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;ds=sidebyside;f=switch-mail-host;h=0132819ba491fddd6299c7bca20d357d5d4149ee;hb=2c39d0edb4d64c34356b8d5d6b65a25ee7aab040;hp=ffb0814b6776e65d0d64366e9c49dd7a5b32e577;hpb=e8d684282c4b3cdd62859217f02711df5947a5c1;p=distro-setup diff --git a/switch-mail-host b/switch-mail-host index ffb0814..0132819 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -61,7 +61,7 @@ fi mail_only=false host2_only=false force=false -mp_args="-m /o,/a,/ar,/q,/qr" +mp_args="-m /o,/a,/ar,/q,/qd,/qr" temp=$(getopt -l force,help aioh "$@") || usage 1 eval set -- "$temp" while true; do @@ -143,18 +143,19 @@ esac if $mail_only; then mp_args="-m /o" elif $host2_only; then - mp_args="-m /a,/ar,/q,/qr" + mp_args="-m /a,/ar,/q,/qd,/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