Files
linuxkit/alpine/packages/hostsettings/etc/init.d/windowsnet
Justin Cormack fed22cee00 Split out Windows network config from hostsettings
On cloud editions eg AWS settings may come from the network, so
we need to move this to after network setup, while the Windows
network config changes need to happen before, so split the init script.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-02 14:49:24 +00:00

30 lines
717 B
Plaintext
Executable File

#!/sbin/openrc-run
description="Configuring Windows network settings from database."
depend() {
before sysctl net
}
start() {
[ "$(mobyplatform)" = "windows" ] || exit 0
ebegin "Configuring Windows network settings from database"
# We have two network interfaces. The Hyper-V interface
# comes up as eth0. Rename and configure it.
ip link set eth0 down
ip link set eth0 name hvint0
mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config`
if [ "${NETCONFIG}" = "static" ]; then
# assume that the other configsDB entries exist
IP=`mobyconfig get net/address`
MASK=`mobyconfig get net/netmask`
ip addr add ${IP}/${MASK} dev hvint0
ip link set hvint0 up
fi
eend 0
}