summaryrefslogtreecommitdiffstats
path: root/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
diff options
context:
space:
mode:
authorJonathan Bauer2020-10-05 16:09:40 +0200
committerJonathan Bauer2020-10-05 16:09:40 +0200
commit417623901bb76396c5506b7963d3a12bf725b156 (patch)
treec1306884a19c259bf93e0600910ec23a81492056 /core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
parent[remote-access] Make sure x11vnc doesn't restart with wrong X instance (diff)
downloadmltk-417623901bb76396c5506b7963d3a12bf725b156.tar.gz
mltk-417623901bb76396c5506b7963d3a12bf725b156.tar.xz
mltk-417623901bb76396c5506b7963d3a12bf725b156.zip
[dhcpc-busybox] merge "search" entries
Diffstat (limited to 'core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index cf4576a7..960da782 100755
--- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -33,7 +33,20 @@ rebuild_resolv_conf () {
[ "x$(readlink "/etc/resolv.conf")" == "x${RESOLV_CONF}" ] || return 0
# Maybe make this smarter some time, if anyone is using clients that are on multiple networks at once etc...
# This is a little braindead but should work most of the time
- sort -u /run/network/*.resolv > "$RESOLV_CONF" 2> /dev/null
+ # See man resolv.conf -> only the last "search" line is valid, thus we merge them
+ sort -u /run/network/*.resolv \
+ | awk '{
+ if ( $1 == "search" )
+ search[++idx] = $2
+ else
+ print $0
+ }
+ END {
+ printf "%s", "search"
+ for (s in search)
+ printf " %s", search[s]
+ }' \
+ > "$RESOLV_CONF" 2> /dev/null
# add support for resolv.conf update scripts // see man(8) resolvconf
for s in /etc/resolvconf/update.d/*.sh; do