NetBSD/distrib/common/10-resolv.conf

23 lines
564 B
Plaintext

# Minimal version using shell builtins.
make_resolv_conf()
{
if [ -z "${new_domain_name_servers}" -a \
-z "${new_domain_name}" -a \
-z "${new_domain_search}" ]; then
return 0
fi
if [ -n "${new_domain_search}" ]; then
echo "search ${new_domain_search}" >> /etc/resolv.conf
elif [ -n "${new_domain_name}" ]; then
echo "search ${new_domain_name}" >> /etc/resolv.conf
fi
for x in ${new_domain_name_servers}; do
echo "nameserver ${x}" >> /etc/resolv.conf
done
}
case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT) make_resolv_conf;;
esac