1.1 --- a/uml-make-network Wed Jul 13 00:43:11 2011 +0200
1.2 +++ b/uml-make-network Mon Jul 18 01:00:41 2011 +0200
1.3 @@ -18,9 +18,9 @@
1.4
1.5 if [ ! -e "$IMAGEDIR/etc/hosts" ]; then
1.6 echo "Creating hosts file..." 1>&2
1.7 - echo "$GUESTADDRESS $GUESTNAME" > "$IMAGEDIR/etc/hosts"
1.8 + echo "$GUESTADDRESS `hostname`" > "$IMAGEDIR/etc/hosts"
1.9 echo "127.0.0.1 localhost" >> "$IMAGEDIR/etc/hosts"
1.10 - echo "$HOSTADDRESS $HOSTNAME" >> "$IMAGEDIR/etc/hosts"
1.11 + echo "$HOSTADDRESS `hostname`-uml" >> "$IMAGEDIR/etc/hosts"
1.12 fi
1.13
1.14 if [ -e "$IMAGEDIR/etc/network/interfaces" ]; then
1.15 @@ -31,14 +31,16 @@
1.16
1.17 if [ ! -e "$IMAGEDIR/etc/network/interfaces" ]; then
1.18 echo "Creating network configuration..." 1>&2
1.19 - echo "auto lo" > "$IMAGEDIR/etc/network/interfaces"
1.20 - echo "iface lo inet loopback" >> "$IMAGEDIR/etc/network/interfaces"
1.21 - echo "iface eth0 inet static" >> "$IMAGEDIR/etc/network/interfaces"
1.22 - echo " network 192.168.0.0" >> "$IMAGEDIR/etc/network/interfaces"
1.23 - echo " broadcast 192.168.0.255" >> "$IMAGEDIR/etc/network/interfaces"
1.24 - echo " address $GUESTADDRESS" >> "$IMAGEDIR/etc/network/interfaces"
1.25 - echo " netmask 255.255.255.0" >> "$IMAGEDIR/etc/network/interfaces"
1.26 - echo " up route add default gw $HOSTADDRESS" >> "$IMAGEDIR/etc/network/interfaces"
1.27 - echo "" >> "$IMAGEDIR/etc/network/interfaces"
1.28 - echo "auto eth0" >> "$IMAGEDIR/etc/network/interfaces"
1.29 + cat > "$IMAGEDIR/etc/network/interfaces" <<EOF
1.30 +auto lo
1.31 +iface lo inet loopback
1.32 +iface eth0 inet static
1.33 + network 192.168.0.0
1.34 + broadcast 192.168.0.255
1.35 + address $GUESTADDRESS
1.36 + netmask 255.255.255.0
1.37 + up route add default gw $HOSTADDRESS
1.38 +
1.39 +auto eth0
1.40 +EOF
1.41 fi