mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-31 08:37:57 +00:00
9049703ce0
Signed-off-by: Zakhar Dvurechensky <72825626+Zakharden@users.noreply.github.com>
14 lines
499 B
Django/Jinja
14 lines
499 B
Django/Jinja
#!/bin/sh
|
|
#
|
|
# Prepend resolver options to /etc/resolv.conf after dhclient`
|
|
# regenerates the file. See man (5) resolver for more details.
|
|
#
|
|
if [ $reason = "BOUND" ]; then
|
|
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
|
RESOLV_CONF=$(cat /etc/resolv.conf | sed -r '/^options (timeout|attempts|ndots).*$/d')
|
|
OPTIONS="options timeout:{{ dns_timeout }} attempts:{{ dns_attempts }} ndots:{{ ndots }}"
|
|
|
|
printf "%b\n" "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
|
fi
|
|
fi
|