diff options
author | James Rayner <james@archlinux.org> | 2008-10-04 01:47:58 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2008-10-04 01:47:58 +0200 |
commit | 5bc67e99f0399b294312ee1cd3555712d97051f6 (patch) | |
tree | e2edfdeb649d14b98ddca2a49848916360484d32 /src | |
parent | 75b7abe2727a9ce7e72721a5c79f070d6126b6b3 (diff) | |
download | netctl-5bc67e99f0399b294312ee1cd3555712d97051f6.tar.gz netctl-5bc67e99f0399b294312ee1cd3555712d97051f6.tar.xz |
Added new DNS=() variable for multiple DNS nameservers
Diffstat (limited to 'src')
-rw-r--r-- | src/ethernet.subr | 9 |
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 } |