2 # Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/05-hostname
3 # Purpose: set hostname of live-system
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
14 # the hostname of the chroot usually isn't the same as the one for the live-system
15 BUILD_HOSTNAME="$($ROOTCMD hostname)"
16 [ -n "$BUILD_HOSTNAME" ] || BUILD_HOSTNAME="grml"
18 echo "$HOSTNAME" > $target/etc/hostname
19 echo "$HOSTNAME" > $target/etc/mailname
21 if [ -r $target/etc/postfix/main.cf ] ; then
22 sed -i "s/^mydestination = .*/mydestination = $HOSTNAME, localhost, localhost.localdomain/" $target/etc/postfix/main.cf
23 sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" $target/etc/postfix/main.cf
24 echo "postfix postfix/mailname string $HOSTNAME" | $ROOTCMD debconf-set-selections
25 echo "postfix postfix/destinations string ${HOSTNAME}, localhost.grml.org, localhost" \
26 | $ROOTCMD debconf-set-selections
27 # make sure to execute newaliases after adjusting configuration,
28 # otherwise the old hostname will be left inside /etc/aliases.db
32 ## END OF FILE #################################################################
33 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2