diff options
author | Bernard Ogden <bernie.ogden@linaro.org> | 2014-12-16 08:42:08 +0000 |
---|---|---|
committer | Bernard Ogden <bernie.ogden@linaro.org> | 2014-12-16 08:42:08 +0000 |
commit | e4ec71db555aa9f35ab52a50ce0255510915724d (patch) | |
tree | 695712f792b509201efcfaa904f2ae9d1f4e96a9 | |
parent | d8bcf2269138881994034cc0e41c9bb6e02201c7 (diff) |
Experiment in better gateway finding
-rwxr-xr-x | invoke_session_oe | 10 |
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) |