X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fgrml-hostname;h=96d4a51fdf1bbac3725dc606ccd9acf73934cb7a;hb=7fdef6630fa17a57c8bbb8f0f222ebfed79bfd15;hp=644b79873dfb496378f3557df084cfd1e8c8d7f2;hpb=093ee7bf398acde737cada410fbe8aaa0184582d;p=grml-scripts.git diff --git a/usr_sbin/grml-hostname b/usr_sbin/grml-hostname index 644b798..96d4a51 100755 --- a/usr_sbin/grml-hostname +++ b/usr_sbin/grml-hostname @@ -4,10 +4,10 @@ # Authors: (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Feb 13 12:16:57 CET 2007 [mika] +# Latest Change: Thu Jan 29 15:56:54 CET 2009 ################################################################################ -source /etc/grml/script-functions +. /etc/grml/script-functions check4root || exit 1 @@ -39,10 +39,12 @@ fi case $retval in 0) echo "$HOSTNAME" > /etc/hostname + echo "$HOSTNAME" > /etc/mailname sed -i "s/^127.0.0.1[ \t]*$OLDHOSTNAME[ \t]*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts sed -i "s/^::1[ \t]*ip6-localhost ip6-loopback[ \t]*$OLDHOSTNAME/::1 ip6-localhost ip6-loopback $HOSTNAME/" /etc/hosts POSTFIX='' if [ -r /etc/postfix/main.cf ] ; then + sed -i "s/^mydestination = .*/mydestination = $HOSTNAME, localhost, localhost.localdomain/" /etc/postfix/main.cf && \ sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" /etc/postfix/main.cf && POSTFIX=' Configuration of myhostname in /etc/postfix/main.cf has been adjusted as well. Do not forget to restart postfix if necessary.' fi