mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-23 22:52:25 +00:00
docker-init: static busybox, support for /etc/network/interfaces
This commit is contained in:
parent
174e7cccea
commit
d472f47829
BIN
gns3server/modules/docker/resources/bin/busybox
Executable file
BIN
gns3server/modules/docker/resources/bin/busybox
Executable file
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/gns3/bin/busybox sh
|
||||
#
|
||||
# Copyright (C) 2016 GNS3 Technologies Inc.
|
||||
#
|
||||
@ -19,6 +19,14 @@
|
||||
# This script is injected into the container and launch before
|
||||
# the start command of the container
|
||||
#
|
||||
OLD_PATH="$PATH"
|
||||
PATH=/gns3/bin:/tmp/gns3/bin
|
||||
|
||||
# bootstrap busybox commands
|
||||
if [ ! -d /tmp/gns3/bin ]; then
|
||||
busybox mkdir -p /tmp/gns3/bin
|
||||
/gns3/bin/busybox --install -s /tmp/gns3/bin
|
||||
fi
|
||||
|
||||
# Wait 2 seconds to settle the network interfaces
|
||||
sleep 2
|
||||
@ -42,5 +50,11 @@ sed -n 's/^ *\(eth[0-9]*\):.*/\1/p' < /proc/net/dev | while read dev; do
|
||||
ip link set dev $dev up
|
||||
done
|
||||
|
||||
if [ -n "$INTERFACES" ]; then
|
||||
echo -e "$INTERFACES" > /etc/network/interfaces
|
||||
ifup -a
|
||||
fi
|
||||
|
||||
# continue normal docker startup
|
||||
PATH="$OLD_PATH"
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user