From 22f0373cdf52e6cdbcbc64100343091ea9eaff47 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 23 May 2022 15:26:31 +0200 Subject: [dhcpc-busybox] Merge SLX_NET_SEARCH with DHCP values --- core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx') 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 3b741c5f..0d74e832 100755 --- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx +++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx @@ -36,6 +36,8 @@ rebuild_resolv_conf () { # Also this will not run resolvconf update.d... No idea if we should still do so... [ -L "/etc/resolv.conf" ] || return 0 [ "$(readlink -f "/etc/resolv.conf")" = "${RESOLV_CONF}" ] || return 0 + # Fake file to merge in search domains from /opt/openslx/config + echo "search $SLX_NET_SEARCH" > "/run/network/zzzzz-openslx.resolv" # Use extglob trickery to make sure br0/$primary stuff comes first # Then print them in a first-come-first-served manner. # Print nameserver entries one per line, print only first domain value, @@ -171,11 +173,11 @@ case "$1" in sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config # Write DOMAIN and SEARCH to /opt/openslx/config if empty if [ -z "$SLX_NET_DOMAIN" ] && [ -n "$domain" ]; then - sed -i "/^SLX_NET_DOMAIN=/d" /opt/openslx/config + sed -i "s/^SLX_NET_DOMAIN=/# &/" /opt/openslx/config echo "SLX_NET_DOMAIN='$domain'" >> /opt/openslx/config fi if [ -z "$SLX_NET_SEARCH" ] && [ -n "$search" ]; then - sed -i "/^SLX_NET_SEARCH=/d" /opt/openslx/config + sed -i "s/^SLX_NET_SEARCH=/# &/" /opt/openslx/config echo "SLX_NET_SEARCH='$search'" >> /opt/openslx/config fi # Same for WINS servers -- cgit v1.2.3-55-g7522