在我的脚本上设置超时和错误消息
我有一个脚本,我试图为如果OPENSL的长时间创建错误消息和超时。这是脚本。谁能帮我吗?我有点迷路。
FILENAME=$1
while read -r ip; do
echo "${ip}"
echo -n | openssl s_client -connect "${ip}:443" -showcerts 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -noout -dates
done < <(cut -d "," -f2 $FILENAME | tail -n +2)
I have a script that im trying to create an error message and timeout for if the openssl takes to long. Here is the script. Can anyone help me? I'm a little lost.
FILENAME=$1
while read -r ip; do
echo "${ip}"
echo -n | openssl s_client -connect "${ip}:443" -showcerts 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -noout -dates
done < <(cut -d "," -f2 $FILENAME | tail -n +2)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从gnu core utils软件包中使用
超时
(手动 )也许做类似的事情:
You could use
timeout
from gnu core utils package(manual)Maybe do something like: