3feead
#!/bin/bash
3feead
3feead
# This example script parses /etc/resolv.conf to retrive DNS information.
3feead
# In the interest of keeping the KVP daemon code free of distro specific
3feead
# information; the kvp daemon code invokes this external script to gather
3feead
# DNS information.
3feead
# This script is expected to print the nameserver values to stdout.
3feead
# Each Distro is expected to implement this script in a distro specific
3feead
# fashion. For instance on Distros that ship with Network Manager enabled,
3feead
# this script can be based on the Network Manager APIs for retrieving DNS
3feead
# entries.
3feead
3feead
cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }'