diff options
author | ScrumpyJack <scrumpyjack@st.ilet.to> | 2016-07-13 12:29:34 +0000 |
---|---|---|
committer | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2016-08-01 16:33:30 +0200 |
commit | 703e83eaed5020ebe2aa4dbfdfce21259abf2e83 (patch) | |
tree | 2803b8c489a1e148e7ed19746b67203eca41598a /main/busybox-initscripts | |
parent | eab83ae2b6062d0562c0a83d35992b50206aa223 (diff) | |
download | aports-703e83eaed5020ebe2aa4dbfdfce21259abf2e83.tar.bz2 aports-703e83eaed5020ebe2aa4dbfdfce21259abf2e83.tar.xz |
main/busybox-initscripts: fix default.script DHCP behaviour
This tells /usr/share/udhcpc/default.script to leave resolv.conf
alone when not sent DHCP options for DNS (option 6) and a search
domain (option 15).
Diffstat (limited to 'main/busybox-initscripts')
-rw-r--r-- | main/busybox-initscripts/default.script | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/main/busybox-initscripts/default.script b/main/busybox-initscripts/default.script index 511c540bec..6bbb8b6f20 100644 --- a/main/busybox-initscripts/default.script +++ b/main/busybox-initscripts/default.script @@ -83,11 +83,27 @@ resolvconf() { for i in $NO_DNS; do [ "$i" = "$interface" ] && return done - echo -n > "$RESOLV_CONF" - [ -n "$domain" ] && echo "search $domain" >> "$RESOLV_CONF" - for i in $dns; do - echo "nameserver $i" >> "$RESOLV_CONF" - done + +# If we are given a domain/dns pair, we use them to replace resolv.conf ... + + if [ -n "$domain" ] && [ -n "$dns" ]; then + echo "search $domain" > "$RESOLV_CONF" + for i in $dns; do + echo "nameserver $i" >> "$RESOLV_CONF" + done + return + fi + +# ... but those who don't like search domains might only give us dns. + + if [ -n "$dns" ]; then + echo -n > "$RESOLV_CONF" + for i in $dns; do + echo "nameserver $i" >> "$RESOLV_CONF" + done + return + fi + } bound() { |