dns/write
This commit is contained in:
parent
ab655c52d9
commit
31e2875965
1 changed files with 21 additions and 10 deletions
|
@ -199,6 +199,26 @@ _spcd_txt_pick() {
|
|||
# │ functions │
|
||||
# ╰───────────╯
|
||||
|
||||
spcd_dns() {
|
||||
local index name value
|
||||
case "${1}" in
|
||||
"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
|
||||
}
|
||||
|
||||
# ╭───────────┬───────╮
|
||||
# │ functions │ error │
|
||||
# ╰───────────┴───────╯
|
||||
|
@ -896,16 +916,7 @@ spcd_query_package() {
|
|||
|
||||
spcd_step__dns() {
|
||||
spcd_step "DNS"
|
||||
local index value text
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
eval "value=\"\${SPCD_DNS_${index}}\""
|
||||
[ -n "${value}" ] || break
|
||||
text="${text}\
|
||||
nameserver ${value}
|
||||
"
|
||||
done
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
spcd_dns "write"
|
||||
}
|
||||
|
||||
# ╭──────┬──────────╮
|
||||
|
|
Loading…
Reference in a new issue