mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 11:44:44 +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
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user