📌  相关文章
📜  检查互联网是否可用 shell 脚本 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:13.504000             🧑  作者: Mango

代码示例1
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