From d6b6cf67516799f987d5e0ecbe393dd670be7c56 Mon Sep 17 00:00:00 2001 From: Frank Henigman Date: Fri, 2 Nov 2012 13:47:16 -0400 Subject: [PATCH] Stop ssh from needlessly consuming stdin. Add -n to remote_sh calls in set_up_remote_access and learn_board. Otherwise the ssh's they start will consume some stdin, making these functions incompatible with a script which needs its stdin. BUG=none TEST=add -n to first remote_sh in cros_adopt_device then "echo y | cros_adopt_device" will work Change-Id: Ic01f69b0a86581c8650f59056d52766e76de1799 Reviewed-on: https://gerrit.chromium.org/gerrit/37251 Tested-by: Frank Henigman Reviewed-by: Chris Wolfe Commit-Ready: Frank Henigman --- remote_access.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote_access.sh b/remote_access.sh index be5d9ddbd3..71e07bfa27 100644 --- a/remote_access.sh +++ b/remote_access.sh @@ -91,7 +91,7 @@ set_up_remote_access() { # Verify the client is reachable before continuing local output local status=0 - if output=$(remote_sh "true" 2>&1); then + if output=$(remote_sh -n "true" 2>&1); then : else status=$? @@ -104,7 +104,7 @@ set_up_remote_access() { # Ask the target what board it is learn_board() { [ -n "${FLAGS_board}" ] && return - remote_sh grep CHROMEOS_RELEASE_BOARD /etc/lsb-release + remote_sh -n grep CHROMEOS_RELEASE_BOARD /etc/lsb-release FLAGS_board=$(echo "${REMOTE_OUT}" | cut -d '=' -f 2) if [ -z "${FLAGS_board}" ]; then error "Board required"