mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 12:38:11 +00:00
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:
parent
8d96529820
commit
ad95c77f90
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user