summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorJonathan Bauer2014-03-11 16:44:15 +0100
committerJonathan Bauer2014-03-11 16:44:15 +0100
commit4967f965fd5b9e9160f7cc0f45d2be250b21063c (patch)
tree7eead28be03ecc1f60a46bd95b3fb8d0792f7e81 /remote
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-4967f965fd5b9e9160f7cc0f45d2be250b21063c.tar.gz
tm-scripts-4967f965fd5b9e9160f7cc0f45d2be250b21063c.tar.xz
tm-scripts-4967f965fd5b9e9160f7cc0f45d2be250b21063c.zip
[udhcpcdcdcdcd] fix wrong hostname name being set
TODO: rewrite this ugly piece of code
Diffstat (limited to 'remote')
-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