Merge pull request #92 from stucki/issue-91

Fix IP address in Debian box templates
This commit is contained in:
Fabio Rehm 2013-06-26 21:24:39 -07:00
commit 198ef66cad
2 changed files with 13 additions and 6 deletions

View file

@ -65,13 +65,19 @@ EOF
cat <<EOF > $rootfs/etc/hostname cat <<EOF > $rootfs/etc/hostname
$hostname $hostname
EOF EOF
# set minimal hosts
cat <<EOF > $rootfs/etc/hosts
127.0.0.1 localhost
127.0.1.1 $hostname
# set the host in case it is not set so that sudo does not complain about the host # The following lines are desirable for IPv6 capable hosts
if ! (grep -q $hostname $rootfs/etc/hosts); then ::1 ip6-localhost ip6-loopback
chroot $rootfs sed -i -e \ fe00::0 ip6-localnet
"s/^127.0.0.1\(\s\+\)localhost$/127.0.0.1\1localhost\n127.0.0.1\1${hostname}/g" \ ff00::0 ip6-mcastprefix
/etc/hosts >/dev/null 2>&1 || true ff02::1 ip6-allnodes
fi ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
EOF
# set default locale # set default locale
cat <<EOF > $rootfs/etc/locale.gen cat <<EOF > $rootfs/etc/locale.gen

View file

@ -67,6 +67,7 @@ fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes ff02::1 ip6-allnodes
ff02::2 ip6-allrouters ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
EOF EOF
if [ ! -f $rootfs/etc/init/container-detect.conf ]; then if [ ! -f $rootfs/etc/init/container-detect.conf ]; then