summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2008-10-04 01:47:58 +0200
committerJames Rayner <james@archlinux.org>2008-10-04 01:47:58 +0200
commit5bc67e99f0399b294312ee1cd3555712d97051f6 (patch)
treee2edfdeb649d14b98ddca2a49848916360484d32 /src
parent75b7abe2727a9ce7e72721a5c79f070d6126b6b3 (diff)
downloadnetctl-5bc67e99f0399b294312ee1cd3555712d97051f6.tar.gz
netctl-5bc67e99f0399b294312ee1cd3555712d97051f6.tar.xz
Added new DNS=() variable for multiple DNS nameservers
Diffstat (limited to 'src')
-rw-r--r--src/ethernet.subr9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ethernet.subr b/src/ethernet.subr
index 654a82b..493394b 100644
--- a/src/ethernet.subr
+++ b/src/ethernet.subr
@@ -78,12 +78,19 @@ ethernet_up() {
fi
# Generate a new resolv.conf
- if [[ -n "$DNS1" ]]; then
+ if [[ -n "$DNS1" ]] || [[ -n "$DNS" ]]; then
+
: >/etc/resolv.conf
[[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf
[[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf
[[ -n "$DNS1" ]] && echo "nameserver $DNS1" >>/etc/resolv.conf
[[ -n "$DNS2" ]] && echo "nameserver $DNS2" >>/etc/resolv.conf
+
+ if [[ -n "$DNS" ]]; then
+ for dns in ${DNS[@]}; do
+ echo "nameserver $dns" >>/etc/resolv.conf
+ done
+ fi
fi
return 0
}