docker-init: static busybox, support for /etc/network/interfaces

This commit is contained in:
Bernhard Ehlers committed 2016-03-22 15:28:56 +00:00
1 parent 174e7cccea
commit d472f47829
2 files changed
+15 -1

No files matched your search

Binary file not shown.
+15 -1
View File
@@ -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 "$@"