X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=3cc12ee3ca8d9b067c2c03c8fe4a888b3f6ac552;hp=c61cb6c0a8e456d7856bb5af0c069039bb7a0e9d;hb=34be1a5b46d770b134219692d080aa7f82070c09;hpb=31fd87f45ce0cd0014fbe67111741a812a654a86 diff --git a/autoconfig.functions b/autoconfig.functions index c61cb6c..3cc12ee 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -354,8 +354,9 @@ config_hostname(){ if checkbootparam 'hostname' ; then HOSTNAME="$(getbootparam 'hostname' 2>>$DEBUG)" einfo "Setting hostname to $HOSTNAME as requested." - sed -i "s/^127.0.0.1.*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts - hostname $HOSTNAME ; eend $? + grml-hostname $HOSTNAME >>$DEBUG ; RC=$? + [ "$RC" = "0" ] && hostname $HOSTNAME + eend $RC else hostname --file /etc/hostname fi