Last active
June 15, 2020 13:07
-
-
Save cybertramp/54cd625c60c144f89b413bf114ab6459 to your computer and use it in GitHub Desktop.
Find the number of name servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ######################################## | |
| # 네임서버 개수 출력 스크립트 | |
| ######################################## | |
| for file in /etc/* | |
| do | |
| if [ "${file}" == "/etc/resolv.conf" ] | |
| then | |
| countNameservers=$(grep -c nameserver /etc/resolv.conf) | |
| echo "Total :${countNameservers} nameservers defined in ${file}" | |
| break | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment