Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
on native we can use docker0

Change-Id: If44ddd1a1cee1a17f41a7a3ce3354368c9275ff9
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
  • Loading branch information
benoitf committed Aug 31, 2016
1 parent 859bca8 commit ecf2e93
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion che-ip/getip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,28 @@

# define network interface variable
NETWORK_IF=

for i in $( ls /sys/class/net ); do
if [ ${i:0:3} = eth ]
then
NETWORK_IF=${i}
fi
done


# if not found, consider native and use docker0
if test -z ${NETWORK_IF}
then
if [ -d "/sys/class/net/docker0" ]; then
NETWORK_IF="docker0"
fi
fi


# if not found, throw error
if test -z ${NETWORK_IF}
then
echo unable to find a eth* interface
echo unable to find a network interface for docker
exit 1
fi

Expand Down

0 comments on commit ecf2e93

Please sign in to comment.