Commit 703e83ea authored by Scrumpy Jack's avatar Scrumpy Jack Committed by Bartłomiej Piotrowski

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).
parent eab83ae2
...@@ -83,11 +83,27 @@ resolvconf() { ...@@ -83,11 +83,27 @@ resolvconf() {
for i in $NO_DNS; do for i in $NO_DNS; do
[ "$i" = "$interface" ] && return [ "$i" = "$interface" ] && return
done done
echo -n > "$RESOLV_CONF"
[ -n "$domain" ] && echo "search $domain" >> "$RESOLV_CONF" # If we are given a domain/dns pair, we use them to replace resolv.conf ...
for i in $dns; do
echo "nameserver $i" >> "$RESOLV_CONF" if [ -n "$domain" ] && [ -n "$dns" ]; then
done 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() { bound() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment