summaryrefslogtreecommitdiffstats
path: root/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-23 15:26:31 +0200
committerSimon Rettberg2022-05-23 15:26:31 +0200
commit22f0373cdf52e6cdbcbc64100343091ea9eaff47 (patch)
tree3b4459a767d52e9758831fb620b3f293a753b238 /core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
parent[debug-report-bwlp] Include dhcpd config for VMs (diff)
downloadmltk-22f0373cdf52e6cdbcbc64100343091ea9eaff47.tar.gz
mltk-22f0373cdf52e6cdbcbc64100343091ea9eaff47.tar.xz
mltk-22f0373cdf52e6cdbcbc64100343091ea9eaff47.zip
[dhcpc-busybox] Merge SLX_NET_SEARCH with DHCP values
Diffstat (limited to 'core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx6
1 files changed, 4 insertions, 2 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 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