You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
570 B

#!/bin/bash
cat ./data/conf.d/*.conf | grep "server_name" | grep -v "#" >> 1.txt #这里需要改成你的nginx路径
sed -i "s#server_name##g" 1.txt
sed -i "s#;##g" 1.txt
DomainList=`cat 1.txt | xargs`
for i in $DomainList
do
DomainResults=`dig $i |grep "192.168.31.249" | wc -l`
if [ $DomainResults -eq 0 ];then
echo "$i 没有解析" >> ErrorDomainList.txt #没有解析的域名存入这个文件里面
else
echo "$i" >> 3.txt #最终有解析的域名存入这个文件
fi
done