Skip to content

Instantly share code, notes, and snippets.

@cybertramp
Last active June 15, 2020 13:07
Show Gist options
  • Select an option

  • Save cybertramp/54cd625c60c144f89b413bf114ab6459 to your computer and use it in GitHub Desktop.

Select an option

Save cybertramp/54cd625c60c144f89b413bf114ab6459 to your computer and use it in GitHub Desktop.
Find the number of name servers.
#!/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