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