X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=072fb4c048a968e23e560d317049ed6b3e735358;hp=b5f1abe3c7e551f0c884db7809c2fac0e7873b88;hb=420ac27e61ea1add01319a4f666bd8fb9dc72bd1;hpb=812194f63ba4eaeeee00615e874e5df48b81677d diff --git a/chroot-script b/chroot-script index b5f1abe..072fb4c 100755 --- a/chroot-script +++ b/chroot-script @@ -253,6 +253,10 @@ hosts() { echo "Setting up /etc/hosts" echo "127.0.0.1 localhost $HOSTNAME" > /etc/hosts fi + + if [ -n "$HOSTNAME" ] ; then + sed -i "s/grml/$HOSTNAME/g" /etc/hosts + fi } # }}} @@ -329,7 +333,14 @@ hostname() { # adjust postfix configuration if [ -r /etc/postfix/main.cf ] ; then + # adjust hostname related options: sed -i "s/grml/$HOSTNAME/g" /etc/postfix/main.cf + sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" /etc/postfix/main.cf + sed -i "s/^mydestination = .*/mydestination = localdomain, localhost, localhost.localdomain, $HOSTNAME/" /etc/postfix/main.cf + + # listen on loopback interface only: + sed -i "s/^inet_interfaces = .*/inet_interfaces = loopback-only/" /etc/postfix/main.cf + grep inet_interfaces /etc/postfix/main.cf || echo 'inet_interfaces = loopback-only' >> /etc/postfix/main.cf fi fi }