summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Ogden <bernie.ogden@linaro.org>2014-12-16 08:42:08 +0000
committerBernard Ogden <bernie.ogden@linaro.org>2014-12-16 08:42:08 +0000
commite4ec71db555aa9f35ab52a50ce0255510915724d (patch)
tree695712f792b509201efcfaa904f2ae9d1f4e96a9
parentd8bcf2269138881994034cc0e41c9bb6e02201c7 (diff)
Experiment in better gateway finding
-rwxr-xr-xinvoke_session_oe10
1 files changed, 10 insertions, 0 deletions
diff --git a/invoke_session_oe b/invoke_session_oe
index afd7dbf..592f0a4 100755
--- a/invoke_session_oe
+++ b/invoke_session_oe
@@ -11,6 +11,16 @@ echo "Target's Gateway: $gateway"
cp /bin/invoke_session /etc/init.d/invoke_session
# Obtain target IP and Hostname
+#Sometimes we can't find the gateway straight away
+c=0
+while test $c -lt 6; do c=$((c+1)); sleep 10; ping -c 1 ${gateway} && break; done
+if test $? -ne 0; then
+ echo "Failed to find gateway, exiting"
+ echo "ifconfig -a says:"
+ ifconfig -a
+ echo "<LAVA_TEST_RUNNER>: exiting"
+ exit
+fi
ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }')
hostname=$(cat /etc/hostname)