fix conf/server.ip creation
[pxelator] / bin / kvm-vde.sh
index 4615e10..cb6da07 100755 (executable)
@@ -4,7 +4,7 @@ if ! grep tap0 /etc/network/interfaces ; then
 
 sudo apt-get install vde2
 
-cat >> /etc/network/interfaces << __add_tap0__
+sudo sh -c "cat >> /etc/network/interfaces" << __add_tap0__
 
 iface tap0 inet static
   address 172.16.10.1
@@ -13,12 +13,12 @@ iface tap0 inet static
 
 __add_tap0__
 
-sudo ifup tap0
-
 fi
 
+sudo ifup tap0
+rm conf/server.ip ; ln -sf 172.16.10.1 conf/server.ip
+
 vdeq kvm -m 512 -net nic,vlan=1,macaddr=52:54:00:12:01:00 \
        -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl \
        -boot n
 
-