From cfa2a73cbdba1ee7cf6a95db1a5d070b4a709b58 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 13 May 2013 15:31:44 +0000 Subject: [PATCH] deployment.sh: set hostname before writing /etc/hosts From: Michael Prokop --- deployment.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment.sh b/deployment.sh index ef1888e..d0d16a5 100755 --- a/deployment.sh +++ b/deployment.sh @@ -929,11 +929,14 @@ if [[ $(chroot $TARGET dpkg --list | awk '/^rc/ {print $2}') != "" ]] ; then chroot $TARGET dpkg --purge $(chroot $TARGET dpkg --list | awk '/^rc/ {print $2}') fi +# make sure `hostname` and `hostname --fqdn` return data from chroot +grml-chroot $TARGET /etc/init.d/hostname.sh + # make sure installations of packages works, will be overriden later again [ -n "$HOSTNAME" ] || HOSTNAME="kantan" cat > $TARGET/etc/hosts << EOF 127.0.0.1 localhost -127.0.0.1 $HOSTNAME +127.0.0.1 $HOSTNAME ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet @@ -942,9 +945,6 @@ ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF -# make sure `hostname` and `hostname --fqdn` return data from chroot -grml-chroot $TARGET /etc/init.d/hostname.sh - # needed for carrier if "$RETRIEVE_MGMT_CONFIG" ; then echo "Retrieving /etc/hosts configuration from management server"