summaryrefslogtreecommitdiff
path: root/hv_get_dns_info.sh
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 16:33:30 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 16:33:30 +0000
commitcac1521eaa808bfcb6e8e20589bd6ae3ac93f33e (patch)
treef7e0a8142a11924708c6df1a071253c56d5f8cb1 /hv_get_dns_info.sh
parent68464c07173d654d0a5011c42a63f04416e6465a (diff)
automatic import of hyperv-daemonsopeneuler24.03_LTS
Diffstat (limited to 'hv_get_dns_info.sh')
-rw-r--r--hv_get_dns_info.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/hv_get_dns_info.sh b/hv_get_dns_info.sh
new file mode 100644
index 0000000..058c17b
--- /dev/null
+++ b/hv_get_dns_info.sh
@@ -0,0 +1,13 @@
+#!/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 }'