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
|
* available
|
||||||
* effective
|
* effective
|
||||||
* factorize
|
* factorize
|
||||||
* dns
|
|
||||||
* locales
|
* locales
|
||||||
* handle errors
|
* handle errors
|
||||||
* packages
|
* packages
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────┬───────╮
|
# ╭───────────┬───────╮
|
||||||
|
|
Loading…
Reference in a new issue