deployment.sh: export $TARGET_HOSTNAME as $HOSTNAME iff available

The $HOSTNAME contains the dhcp client name during deployment otherwise :(

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 13 years ago
parent cfa2a73cbd
commit 13f2d09599

@ -296,6 +296,13 @@ if checkBootParam ngcphostname ; then
TARGET_HOSTNAME="$(getBootParam ngcphostname)" || true TARGET_HOSTNAME="$(getBootParam ngcphostname)" || true
fi fi
if [ -n "$TARGET_HOSTNAME" ] ; then
export HOSTNAME="$TARGET_HOSTNAME"
else
[ -n "$HOSTNAME" ] || HOSTNAME="nohostname"
export HOSTNAME
fi
if checkBootParam ngcpip1 ; then if checkBootParam ngcpip1 ; then
IP1=$(getBootParam ngcpip1) IP1=$(getBootParam ngcpip1)
fi fi
@ -933,7 +940,6 @@ fi
grml-chroot $TARGET /etc/init.d/hostname.sh grml-chroot $TARGET /etc/init.d/hostname.sh
# make sure installations of packages works, will be overriden later again # make sure installations of packages works, will be overriden later again
[ -n "$HOSTNAME" ] || HOSTNAME="kantan"
cat > $TARGET/etc/hosts << EOF cat > $TARGET/etc/hosts << EOF
127.0.0.1 localhost 127.0.0.1 localhost
127.0.0.1 $HOSTNAME 127.0.0.1 $HOSTNAME

Loading…
Cancel
Save