diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 15:35:30 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 15:35:30 +0100 |
commit | 03384208e0e05697570ec8d61cf6bb940c9ee0a1 (patch) | |
tree | 70ceb530a7e2c8216b81539caae24d60ee06231c /setup-mta.in | |
parent | e5c17c7326676a78a09295baccabd83b10a69e33 (diff) | |
download | alpine-conf-03384208e0e05697570ec8d61cf6bb940c9ee0a1.zip |
setup-mta: cleanup. use ask
Diffstat (limited to 'setup-mta.in')
-rw-r--r-- | setup-mta.in | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/setup-mta.in b/setup-mta.in index 8a3f544..7ae0979 100644 --- a/setup-mta.in +++ b/setup-mta.in @@ -33,13 +33,11 @@ fi res= while [ "$res" != "221" ]; do - echon "Outgoing mail server? (e.g 'smtp.isp.com') [$mailhub] " - default_read mailhub $mailhub - echon "Test connection? (y/n) [y] " - default_read testconn "y" - case "$testconn" in - [Nn]*) break;; - esac + ask "Outgoing mail server? (e.g 'smtp.isp.com')" "$mailhub" + mailhub="$resp" + if ! ask_yesno "Test connection? (y/n)" y; then + break + fi res=$(echo -e "quit\r\n" | nc $mailhub 25 | awk '/^221/ {print $1}') [ "x$res" = "x221" ] && echo "Connection to $mailhub is ok." done |