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