我正在编写一个shell脚本来保存域名列表的ssl证书。当openssl正确响应时,循环正在be早期。
#!/bin/bash
cat urls | while read url
do
echo "processing $url ..."
domain=`echo $url | cut -d'/' -f3 | cut -d':' -f1`
timeout 30 openssl s_client -connect $domain:443 -servername $domain > $domain.pem 2>/dev/null
done
以下是urls文件的示例:
https://app.singstat.gov.sg/rss/rssfeed.aspx
https://bugs.maemo.org/attachment.cgi?id=644
https://www.audisaradarpb.com/sfp/SFP_EF_html/Portal/Public_Page/
https://www.bankerstrust.com/news/index.html