웹서버에서 도메인 긁어와서 도메인이 서버로 연결되는지 확인
세팅된 도메인이 local 서버가 아닌 타IP로 연결되는 것을 확인하기 위한 쉘
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
ServerIp=`hostname -i` DomainListFile='/opt/delete_domain.txt' touch $DomainListFile HttpdConf=`grep -Hlr '</VirtualHost>' /usr/local/apache/conf/* | grep -vE 'original|owasp|ssl|old'` NowSettingDomain=`grep ServerName $HttpdConf | awk '{print $2}'` for NSD in $NowSettingDomain do NsDomainCnt=`/bin/host -t A $NSD | awk '{print $NF}' | wc -l` NsDomainIP=`/bin/host -t A $NSD | awk '{print $NF}'` if [[ $NsDomainCnt -eq 1 ]]; then echo -e "$NSD \t:\t $NsDomainIP" else echo -e "$NSD \t:\t No match for domain" fi done | grep -v $ServerIp >> /opt/delete_domain.txt |