swh:1:snp:c2847dfd741eae21606027cf29250d1ebcd63fb4
Raw File
Tip revision: a71c9a1c779f2499fb2afc0553e543f18aff6edf authored by Linus Torvalds on 03 April 2017, 00:23:54 UTC
Linux 4.11-rc5
Tip revision: a71c9a1
hv_get_dns_info.sh
#!/bin/bash

# This example script parses /etc/resolv.conf to retrive DNS information.
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to gather
# DNS information.
# This script is expected to print the nameserver values to stdout.
# Each Distro is expected to implement this script in a distro specific
# fashion. For instance on Distros that ship with Network Manager enabled,
# this script can be based on the Network Manager APIs for retrieving DNS
# entries.

cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }'
back to top