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
}
# }}}
# 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
}
- do not create stage file at finalize()
* Edit /etc/network/interfaces as well if the file exists already,
we definitely need at least a loopback interface.
- * Adjust hostname in /etc/postfix/main.cf.
+ * Adjust postfix configuration:
+ - modify hostname related options in /etc/postfix/main.cf
+ - listen on loopback interface by default (thanks for suggestion, gebi)
* Unify the --bootappend option, it's not --boot_append (thanks for
the hint, Tong Sun).
* Support execution of further scripts via options --scripts and