This commit is contained in:
Marc Beninca 2024-05-02 10:27:18 +02:00
parent 0cb9952b32
commit c356baee6d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

10
cd.sh
View file

@ -1,8 +1,10 @@
#! /usr/bin/env sh #! /usr/bin/env sh
[ "${CD_DNS}" ] || CD_DNS="\ # defaults
CD_DEFAULT_DNS="\
9.9.9.9 \ 9.9.9.9 \
" "
CD_PYTHON_MODULES="\ CD_PYTHON_MODULES="\
cd \ cd \
rwx \ rwx \
@ -11,7 +13,7 @@ rwx \
# main # main
cd_main () { cd_main () {
cd_set_environment cd_set_environment
cd_set_dns_resolving ${CD_DNS} cd_set_dns_resolving
cd_set_packages_repositories cd_set_packages_repositories
cd_set_packages_configuration cd_set_packages_configuration
cd_write_ca_certificates cd_write_ca_certificates
@ -102,9 +104,11 @@ local variable
cd_set_dns_resolving () { cd_set_dns_resolving () {
local server local server
local servers
local text="" local text=""
cd_step "Set DNS resolving" 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} text="${text}nameserver ${server}
" "
done done