flatcar-scripts/bin/cros_get_chrome_version
Chris Sosa 4e75efa930 Add option to check version of Chrome on target.
Change-Id: I34e9d64656e04d4f5c477914512219d9b8563b78

BUG=chromium-os:9137
TEST=Ran with both wrong and right versions against a Google Chrome and
Chromium build

Review URL: http://codereview.chromium.org/4942001
2010-11-15 15:12:06 -08:00

26 lines
669 B
Bash
Executable File

#!/bin/bash
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Returns the version of Chrome running on a remote machine.
. "$(dirname $0)/../common.sh"
. "$(dirname $0)/../remote_access.sh"
FLAGS "$@" || exit 1
set -e
# TMP necessary for remote_access_init.
TMP=$(mktemp -d /tmp/cros_check_chrome_version.XXXX)
trap "rm -rf ${TMP}" EXIT
remote_access_init &> /dev/null
remote_sh "/opt/google/chrome/chrome --version"
CHROME_VERSION=$(echo ${REMOTE_OUT} | \
sed 's/.* \([0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\).*/\1/')
echo "${CHROME_VERSION}"