hvtools: fix script to configure the IP address from the host

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2016-02-02 19:12:52 -08:00
parent 8d96529820
commit ad95c77f90

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# This example script activates an interface based on the specified # This example script activates an interface based on the specified
# configuration. # configuration.
@ -70,21 +70,20 @@ ifdown $DEVICE
# create a new interfaces file # create a new interfaces file
echo "auto lo" > $outf echo "auto lo" > $outf
echo "iface lo inet loopback" >> $outf echo "iface lo inet loopback" >> $outf
echo "" >> outf echo "" >> $outf
echo "auto $DEVICE" >> $outf echo "auto $DEVICE" >> $outf
if [ "$BOOTPROTO" = "dhcp" ]; then if [ "$BOOTPROTO" = "dhcp" ]; then
echo "iface $DEVICE inet dhcp" >> $outf echo "iface $DEVICE inet dhcp" >> $outf
else else
echo "iface $DEVICE inet static" >> $outf echo "iface $DEVICE inet static" >> $outf
echo " address $IPADDR0" >> outf echo " address $IPADDR0" >> $outf
echo " netmask $NETMASK0" >> outf echo " netmask $NETMASK0" >> $outf
echo " gateway $GATEWAY" >> outf echo " gateway $GATEWAY" >> $outf
echo " nameserver $DNS1 $DNS2 $DNS3" >> $outf
fi fi
echo " nameserver $DNS0" >> outf echo " hwaddress ether $HWADDR" >> $outf
echo " hwaddress ether $HWADDR" >> outf
# Up the interface # Up the interface
ifup $DEVICE ifup $DEVICE