📅  最后修改于: 2022-03-11 14:51:13.504000             🧑  作者: Mango
test=google.com
if nc -zw1 $test 443 && echo |openssl s_client -connect $test:443 2>&1 |awk '
handshake && $1 == "Verification" { if ($2=="OK") exit; exit 1 }
$1 $2 == "SSLhandshake" { handshake = 1 }'
then
echo "we have connectivity"
fi