X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;fp=chroot-script;h=eb2963ffcec6742d3032f40cbd5fce3093aa2a88;hp=256ae60dd2a537f81803441dfd4632a1dddc76cb;hb=36a961d4534d6c6476e2416776fda21d1806b4b5;hpb=19344b969618f82c97158c0e42ebc5ae7c4fcade diff --git a/chroot-script b/chroot-script index 256ae60..eb2963f 100755 --- a/chroot-script +++ b/chroot-script @@ -427,24 +427,12 @@ passwords() # set up /etc/hosts {{{ hosts() { - if [ -f /etc/hosts ] ; then - sed -i "s#127.0.0.1 .*#127.0.0.1 localhost $HOSTNAME#" /etc/hosts - [ -n "$HOSTNAME" ] && sed -i "s/grml/$HOSTNAME/g" /etc/hosts - else + if ! [ -f /etc/hosts ] ; then cat > /etc/hosts << EOF -127.0.0.1 localhost $HOSTNAME - -#127.0.0.1 localhost -#127.0.1.1 $HOSTNAME.example.org $HOSTNAME - -# The following lines are desirable for IPv6 capable hosts -#::1 ip6-localhost ip6-loopback $HOSTNAME -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -ff02::3 ip6-allhosts +127.0.0.1 localhost +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters EOF fi }