diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index fb89491..c1e64aa 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -235,30 +235,6 @@ spcd_ca() { done } -spcd_dns() { - local index name text value - while true; do - index=$((index + 1)) - name="SPCD_DNS_${index}" - eval "value=\"\${${name}}\"" - [ -n "${value}" ] || break - case "${1}" in - "list") - spcd_os_printenv "${name}" - ;; - "write") - text="${text}\ -nameserver ${value} -" - ;; - *) ;; - esac - done - if [ "${1}" = "write" ]; then - spcd_os_write "/etc/resolv.conf" "${text}" - fi -} - spcd_run() { if [ -n "${1}" ]; then _spcd_frame_open "${@}" @@ -426,7 +402,7 @@ SPCD_PM_ZYPPER="zypper" spcd_step__environment_print() { spcd_ca "list" - spcd_dns "list" + spcd_f_dns "list" set -- \ "GIT_RWX" \ "GIT_SPCD" \ @@ -794,6 +770,30 @@ spcd_step__environment_list_workspace() { # │ f = function │ # ╰──────────────╯ +spcd_f_dns() { + local index name text value + while true; do + index=$((index + 1)) + name="SPCD_DNS_${index}" + eval "value=\"\${${name}}\"" + [ -n "${value}" ] || break + case "${1}" in + "list") + spcd_os_printenv "${name}" + ;; + "write") + text="${text}\ +nameserver ${value} +" + ;; + *) ;; + esac + done + if [ "${1}" = "write" ]; then + spcd_os_write "/etc/resolv.conf" "${text}" + fi +} + spcd_git_clone() { if [ -n "${1}" ]; then local name path url @@ -1563,7 +1563,7 @@ spcd_main() { spcd_step_out # dns spcd_step "DNS" - spcd_dns "write" + spcd_f_dns "write" # packages spcd_step_in "Packages" spcd_step__packages_set_repositories