From af7d5d11a591b5a41e741187a701e49c3dbd6e13 Mon Sep 17 00:00:00 2001 From: Gaurav Shah Date: Wed, 21 Sep 2011 16:42:16 -0700 Subject: [PATCH] remote_access.sh: Be verbose when remote accesss setup fails. Silent otherwise. A parallel change in run_remote_tests.sh (http://gerrit.chromium.org/gerrit/8090) ensures that the output of the command isn't ignored (since now it is only verbose when it needs to be). BUG=chromium-os:20695 TEST=Ran run_remote_tests.sh with both valid and invalid ip (again). Change-Id: I185c81b0a8193bfa5f88ff2b9eea38dabe24edcc Reviewed-on: http://gerrit.chromium.org/gerrit/8089 Commit-Ready: Gaurav Shah Reviewed-by: Gaurav Shah Tested-by: Gaurav Shah --- remote_access.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/remote_access.sh b/remote_access.sh index b46d8fedfb..2c482ccdd3 100644 --- a/remote_access.sh +++ b/remote_access.sh @@ -54,9 +54,16 @@ function set_up_remote_access() { chmod 0400 $TMP_PRIVATE_KEY # Verify the client is reachable before continuing - echo "Initiating first contact with remote host" - remote_sh "true" - echo "Connection OK" + local output + local status=0 + if output=$(remote_sh "true" 2>&1); then + : + else + status=$? + echo "Could not initiate first contact with remote host" + echo "$output" + fi + return $status } # Ask the target what board it is