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
# configuration.
@ -70,21 +70,20 @@ ifdown $DEVICE
# create a new interfaces file
echo "auto lo" > $outf
echo "iface lo inet loopback" >> $outf
echo "" >> outf
echo "" >> $outf
echo "auto $DEVICE" >> $outf
if [ "$BOOTPROTO" = "dhcp" ]; then
echo "iface $DEVICE inet dhcp" >> $outf
else
echo "iface $DEVICE inet static" >> $outf
echo " address $IPADDR0" >> outf
echo " netmask $NETMASK0" >> outf
echo " gateway $GATEWAY" >> outf
echo " address $IPADDR0" >> $outf
echo " netmask $NETMASK0" >> $outf
echo " gateway $GATEWAY" >> $outf
echo " nameserver $DNS1 $DNS2 $DNS3" >> $outf
fi
echo " nameserver $DNS0" >> outf
echo " hwaddress ether $HWADDR" >> outf
echo " hwaddress ether $HWADDR" >> $outf
# Up the interface
ifup $DEVICE