From ecf2e930586fc608485c6c2838d45aacf2090e0d Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Wed, 31 Aug 2016 17:16:40 +0200 Subject: [PATCH] Fix for https://github.com/eclipse/che/issues/2284 on native we can use docker0 Change-Id: If44ddd1a1cee1a17f41a7a3ce3354368c9275ff9 Signed-off-by: Florent BENOIT --- che-ip/getip.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/che-ip/getip.sh b/che-ip/getip.sh index e4fe6ef0..d1473817 100755 --- a/che-ip/getip.sh +++ b/che-ip/getip.sh @@ -7,6 +7,7 @@ # define network interface variable NETWORK_IF= + for i in $( ls /sys/class/net ); do if [ ${i:0:3} = eth ] then @@ -14,10 +15,20 @@ for i in $( ls /sys/class/net ); do 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