This commit is contained in:
Marc Beninca 2024-09-08 23:01:41 +02:00
parent 6685170c4f
commit dc47ace951
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -235,30 +235,6 @@ spcd_ca() {
done 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() { spcd_run() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
_spcd_frame_open "${@}" _spcd_frame_open "${@}"
@ -426,7 +402,7 @@ SPCD_PM_ZYPPER="zypper"
spcd_step__environment_print() { spcd_step__environment_print() {
spcd_ca "list" spcd_ca "list"
spcd_dns "list" spcd_f_dns "list"
set -- \ set -- \
"GIT_RWX" \ "GIT_RWX" \
"GIT_SPCD" \ "GIT_SPCD" \
@ -794,6 +770,30 @@ spcd_step__environment_list_workspace() {
# │ f = function │ # │ 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() { spcd_git_clone() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
local name path url local name path url
@ -1563,7 +1563,7 @@ spcd_main() {
spcd_step_out spcd_step_out
# dns # dns
spcd_step "DNS" spcd_step "DNS"
spcd_dns "write" spcd_f_dns "write"
# packages # packages
spcd_step_in "Packages" spcd_step_in "Packages"
spcd_step__packages_set_repositories spcd_step__packages_set_repositories