判断域名证书过期时间

root@tr-desktop:/home/tr# cat cert.sh
#!/bin/bash

# 要检查的域名
domain="oa.torealize.work"

# 获取证书的到期日期
expiry_date=$(echo | openssl s_client -connect "$domain:443" 2>/dev/null | openssl x509 -noout -enddate | sed "s/^notAfter=//")

# 输出证书的到期日期
echo "证书的过期时间是: $expiry_date"

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: