mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02:00
parent
775ee4259e
commit
c829a250a9
@ -24,15 +24,20 @@ PATH=/gns3/bin:/tmp/gns3/bin
|
|||||||
|
|
||||||
# bootstrap busybox commands
|
# bootstrap busybox commands
|
||||||
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore file permission and mount volumes
|
# Restore file permission and mount volumes
|
||||||
echo "$GNS3_VOLUMES" | tr ":" "\n" | while read i
|
for i in $(echo "$GNS3_VOLUMES" | tr ":" "\n")
|
||||||
do
|
do
|
||||||
# Copy original files if destination is empty (first start)
|
# Copy original files if destination is empty (first start)
|
||||||
[ "$(ls -A "/gns3volumes$i")" ] || cp -a "$i/." "/gns3volumes$i"
|
if ! [ "$(ls -A /gns3volumes$i)" ]; then
|
||||||
|
for file in $(ls -A "$i")
|
||||||
|
do
|
||||||
|
cp -a "$i/$file" "/gns3volumes$i/$file"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
mount --bind "/gns3volumes$i" "$i"
|
mount --bind "/gns3volumes$i" "$i"
|
||||||
if [ -f "$i/.gns3_perms" ]
|
if [ -f "$i/.gns3_perms" ]
|
||||||
@ -48,13 +53,13 @@ done
|
|||||||
|
|
||||||
# /etc/hosts
|
# /etc/hosts
|
||||||
[ -s /etc/hosts ] || cat > /etc/hosts << __EOF__
|
[ -s /etc/hosts ] || cat > /etc/hosts << __EOF__
|
||||||
127.0.1.1 $HOSTNAME
|
127.0.1.1 $HOSTNAME
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
::1 localhost ip6-localhost ip6-loopback
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
fe00::0 ip6-localnet
|
fe00::0 ip6-localnet
|
||||||
ff00::0 ip6-mcastprefix
|
ff00::0 ip6-mcastprefix
|
||||||
ff02::1 ip6-allnodes
|
ff02::1 ip6-allnodes
|
||||||
ff02::2 ip6-allrouters
|
ff02::2 ip6-allrouters
|
||||||
__EOF__
|
__EOF__
|
||||||
|
|
||||||
# configure loopback interface
|
# configure loopback interface
|
||||||
@ -69,7 +74,7 @@ done
|
|||||||
|
|
||||||
# activate 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
|
# configure network interfaces
|
||||||
|
Loading…
Reference in New Issue
Block a user