mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Minor cleanup on docker-init
This commit is contained in:
parent
c1193c23c1
commit
498d006225
@ -181,6 +181,8 @@ class DockerVM(BaseVM):
|
|||||||
os.makedirs(path, exist_ok=True)
|
os.makedirs(path, exist_ok=True)
|
||||||
os.makedirs(os.path.join(path, "if-up.d"), exist_ok=True)
|
os.makedirs(os.path.join(path, "if-up.d"), exist_ok=True)
|
||||||
os.makedirs(os.path.join(path, "if-down.d"), exist_ok=True)
|
os.makedirs(os.path.join(path, "if-down.d"), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(path, "if-pre-up.d"), exist_ok=True)
|
||||||
|
os.makedirs(os.path.join(path, "if-post-down.d"), exist_ok=True)
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(path, "interfaces")):
|
if not os.path.exists(os.path.join(path, "interfaces")):
|
||||||
with open(os.path.join(path, "interfaces"), "w+") as f:
|
with open(os.path.join(path, "interfaces"), "w+") as f:
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#!/tmp/gns3/bin/sh
|
|
||||||
|
|
||||||
exec busybox udhcpc -s /gns3/etc/udhcpc/default.script "$@"
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/tmp/gns3/bin/sh
|
|
||||||
|
|
||||||
exec busybox udhcpc6 -s /gns3/etc/udhcpc/default.script "$@"
|
|
@ -26,8 +26,6 @@ PATH=/gns3/bin:/tmp/gns3/bin
|
|||||||
if [ ! -d /tmp/gns3/bin ]; then
|
if [ ! -d /tmp/gns3/bin ]; then
|
||||||
busybox mkdir -p /tmp/gns3/bin
|
busybox mkdir -p /tmp/gns3/bin
|
||||||
/gns3/bin/busybox --install -s /tmp/gns3/bin
|
/gns3/bin/busybox --install -s /tmp/gns3/bin
|
||||||
# remove commands already available in /gns3/bin
|
|
||||||
(cd /tmp/gns3/bin; rm -f `cd /gns3/bin; echo *`)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wait 2 seconds to settle the network interfaces
|
# Wait 2 seconds to settle the network interfaces
|
||||||
@ -47,12 +45,12 @@ __EOF__
|
|||||||
# configure loopback interface
|
# configure loopback interface
|
||||||
ip link set dev lo up
|
ip link set dev lo up
|
||||||
|
|
||||||
# configure eth interfaces
|
# activate eth interfaces
|
||||||
sed -n 's/^ *\(eth[0-9]*\):.*/\1/p' < /proc/net/dev | while read dev; do
|
sed -n 's/^ *\(eth[0-9]*\):.*/\1/p' < /proc/net/dev | while read dev; do
|
||||||
ip link set dev $dev up
|
ip link set dev $dev up
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# configure network interfaces
|
||||||
ifup -a -f
|
ifup -a -f
|
||||||
|
|
||||||
# continue normal docker startup
|
# continue normal docker startup
|
||||||
|
Loading…
Reference in New Issue
Block a user