deployment.sh: set hostname before writing /etc/hosts

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

@ -929,6 +929,9 @@ if [[ $(chroot $TARGET dpkg --list | awk '/^rc/ {print $2}') != "" ]] ; then
chroot $TARGET dpkg --purge $(chroot $TARGET dpkg --list | awk '/^rc/ {print $2}') chroot $TARGET dpkg --purge $(chroot $TARGET dpkg --list | awk '/^rc/ {print $2}')
fi 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 # make sure installations of packages works, will be overriden later again
[ -n "$HOSTNAME" ] || HOSTNAME="kantan" [ -n "$HOSTNAME" ] || HOSTNAME="kantan"
cat > $TARGET/etc/hosts << EOF cat > $TARGET/etc/hosts << EOF
@ -942,9 +945,6 @@ ff02::1 ip6-allnodes
ff02::2 ip6-allrouters ff02::2 ip6-allrouters
EOF EOF
# make sure `hostname` and `hostname --fqdn` return data from chroot
grml-chroot $TARGET /etc/init.d/hostname.sh
# needed for carrier # needed for carrier
if "$RETRIEVE_MGMT_CONFIG" ; then if "$RETRIEVE_MGMT_CONFIG" ; then
echo "Retrieving /etc/hosts configuration from management server" echo "Retrieving /etc/hosts configuration from management server"

Loading…
Cancel
Save