]> git.plutz.net Git - blast/commitdiff
hostname to hosts file correction
authorPaul Hänsch <paul@plutz.net>
Thu, 26 Sep 2019 08:42:10 +0000 (10:42 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 26 Sep 2019 08:42:10 +0000 (10:42 +0200)
modules/default.mk

index d4c9640e5a15642053de226431e53a0e333d7add..7719ce4d484bc33423df543240e745650491a820 100644 (file)
@@ -102,7 +102,7 @@ _users: ${CFGROOT}
 
 _hostname: ${CFGROOT}
        printf '%s\n' "$${hostname}" >"$${CFGROOT}/etc/hostname"
-       sed -Ei "/127.0.0.1/a   $${hostname}" "$${CFGROOT}/etc/hosts"
+       sed -Ei "s;^127\.0\.0\.1.*$$;\1 $${hostname};" "$${CFGROOT}/etc/hosts"
 
 ifdef wifi
   _config: ${CFGROOT}/etc/network/interfaces.d/wifi