summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xremote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx7
1 files changed, 4 insertions, 3 deletions
diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index 17932f48..2675afc2 100755
--- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -106,6 +106,7 @@ case "$1" in
# Things that should only happen for the main interface that was used for booting
if [ "$interface" == "br0" ]; then
dns_host=$(rdns "$ip")
+ short="${dns_host%%.*}"
# Update IP
sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config
@@ -122,8 +123,8 @@ case "$1" in
fi
# finally, if dns_host was set to anything, apply it
if [ -n "$dns_host" ]; then
- echo "$dns_host" > "/proc/sys/kernel/hostname"
- echo "$dns_host" > "/etc/hostname"
+ echo "$short" > "/proc/sys/kernel/hostname"
+ echo "$short" > "/etc/hostname"
if grep '^SLX_HOSTNAME=' /opt/openslx/config 2>/dev/null; then
sed -i "s/^\(SLX_HOSTNAME=\).*$/\1'$dns_host'/" /opt/openslx/config
else
@@ -134,7 +135,7 @@ case "$1" in
# if domain is given from dhcp, save it to openslx config for later use in VMs
if [ -n "$domain" ]; then
- # check if SLX_NET_DOMAIN is in the config at all
+ # check if SLX_NET_DOMAIN is in the config at all
if grep '^SLX_NET_DOMAIN=' /opt/openslx/config 2>/dev/null; then
sed -i "s/^\(SLX_NET_DOMAIN=\).*$/\1'$domain'/" /opt/openslx/config
else