timeout 2
This commit is contained in:
+2
-1
@@ -6,7 +6,7 @@ function usage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function connect_server {
|
function connect_server {
|
||||||
openssl s_client -starttls smtp -connect "$server:587" -ign_eof 2>/dev/null <<EOF
|
timeout 2 openssl s_client -starttls smtp -connect "$server:587" -ign_eof 2>/dev/null <<EOF
|
||||||
quit
|
quit
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ EOF
|
|||||||
|
|
||||||
function check_smtp_connection {
|
function check_smtp_connection {
|
||||||
echo -n "check smtp server <$server> port 587 ... "
|
echo -n "check smtp server <$server> port 587 ... "
|
||||||
|
set +e
|
||||||
if connect_server | grep -q CONNECTED; then
|
if connect_server | grep -q CONNECTED; then
|
||||||
echo SUCCESSFUL CONNECTION
|
echo SUCCESSFUL CONNECTION
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user