尝试构建一个shell脚本,该脚本确定站点是否使用PulseVPN。脚本接受一个包含URL列表的输入文件,逐行迭代每个URL,对特定的字符串执行cURL操作和grep。如果找到字符串,则显示回显消息“网站使用PulseVPN”。
这是我的代码-
Keyword="dana-na" # keyword to find for PulseSecure SSL VPN
while read -r line;
do
if curl -s -L "$line" | grep "$keyword" > /dev/null
then
# if the keyword is in the conent
echo " The website $line is using Pulse Secure VPN"
else
echo "Pulse Secure VPN Not Found on $line"
fi
done < urls.txt问题代码正在工作,但这里的问题是,当我在输入文件中只包含一个URL时。给出了正确的结果。但是,如果我在输入文件中包含了多个URL,那么它会给出不正确的结果。有人能解释为什么会发生这种事吗。密码有什么问题吗?
发布于 2019-12-18 20:40:58
https://stackoverflow.com/questions/59399455
复制相似问题