Make specification of NETMASK and GATEWAY mandatory; they cannot be
[invirt/packages/invirt-autoinstaller.git] / guest / etc / init.d / rcS.invirt
index 84cfedb..f796bf2 100755 (executable)
@@ -29,6 +29,8 @@ mount -t tmpfs none /tmp
 export TARGET=/dev/hda
 export ARCH=${ARCH-amd64}
 export IP=$(ifconfig eth0 | sed -n 's/.*inet addr:\([0-9\.]*\).*/\1/p')
+export NETMASK=$(ifconfig eth0 | sed -n 's/.*inet addr:.*Mask:\([0-9\.]*\).*/\1/p')
+export GATEWAY=$(ip route list | sed -n 's/default via \([0-9\.]*\).*/\1/p')
 export HOSTNAME=$(hostname)
 
 /etc/init.d/udev start