factorize/dns
This commit is contained in:
parent
095b343fde
commit
a0122d5ea3
2 changed files with 16 additions and 22 deletions
|
@ -230,7 +230,6 @@ Handle project workflows in a unified way:
|
|||
* available
|
||||
* effective
|
||||
* factorize
|
||||
* dns
|
||||
* locales
|
||||
* handle errors
|
||||
* packages
|
||||
|
|
|
@ -224,32 +224,27 @@ spcd_ca() {
|
|||
}
|
||||
|
||||
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
|
||||
"list")
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
spcd_os_printenv "${name}"
|
||||
done
|
||||
;;
|
||||
"write")
|
||||
local text
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
text="${text}\
|
||||
nameserver ${value}
|
||||
"
|
||||
done
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
if [ "${1}" = "write" ]; then
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
fi
|
||||
}
|
||||
|
||||
# ╭───────────┬───────╮
|
||||
|
|
Loading…
Reference in a new issue