From c356baee6de36204ef1ef753917dd61ab504becb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:27:18 +0200 Subject: [PATCH] dns --- cd.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index a0f90ba..930e37e 100644 --- a/cd.sh +++ b/cd.sh @@ -1,8 +1,10 @@ #! /usr/bin/env sh -[ "${CD_DNS}" ] || CD_DNS="\ +# defaults +CD_DEFAULT_DNS="\ 9.9.9.9 \ " + CD_PYTHON_MODULES="\ cd \ rwx \ @@ -11,7 +13,7 @@ rwx \ # main cd_main () { cd_set_environment - cd_set_dns_resolving ${CD_DNS} + cd_set_dns_resolving cd_set_packages_repositories cd_set_packages_configuration cd_write_ca_certificates @@ -102,9 +104,11 @@ local variable cd_set_dns_resolving () { local server +local servers local text="" cd_step "Set DNS resolving" - for server in "${@}" ; do + "${CD_DNS}" && servers="${CD_DNS}" || servers="${CD_DEFAULT_DNS}" + for server in ${servers} ; do text="${text}nameserver ${server} " done