mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-06 07:52:45 +00:00
Add basic database setup for AWS, GCP although these are not yet used by the setup code but will be useful later. Currently each is gated by `mobyplatform` but this can be removed once we construct Moby per platform, and once these are containerised so they are not run from `openrc`. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
31 lines
740 B
Plaintext
Executable File
31 lines
740 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
description="Configuring Windows network settings from database."
|
|
|
|
depend() {
|
|
need database-windows
|
|
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
|
|
}
|