factorize/dns

This commit is contained in:
Marc Beninca 2024-09-03 18:19:26 +02:00
parent 095b343fde
commit a0122d5ea3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 16 additions and 22 deletions

View file

@ -230,7 +230,6 @@ Handle project workflows in a unified way:
* available * available
* effective * effective
* factorize * factorize
* dns
* locales * locales
* handle errors * handle errors
* packages * packages

View file

@ -224,32 +224,27 @@ spcd_ca() {
} }
spcd_dns() { spcd_dns() {
local index name value local index name text value
while true; do
index=$((index + 1))
name="SPCD_DNS_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
case "${1}" in case "${1}" in
"list") "list")
while true; do
index=$((index + 1))
name="SPCD_DNS_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
spcd_os_printenv "${name}" spcd_os_printenv "${name}"
done
;; ;;
"write") "write")
local text
while true; do
index=$((index + 1))
name="SPCD_DNS_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
text="${text}\ text="${text}\
nameserver ${value} nameserver ${value}
" "
done
spcd_os_write "/etc/resolv.conf" "${text}"
;; ;;
*) ;; *) ;;
esac esac
done
if [ "${1}" = "write" ]; then
spcd_os_write "/etc/resolv.conf" "${text}"
fi
} }
# ╭───────────┬───────╮ # ╭───────────┬───────╮