From b85bed0c0d52d60c1b45da69a49c8add558e0e84 Mon Sep 17 00:00:00 2001 From: "garykac@chromium.org" Date: Wed, 19 Dec 2012 23:45:41 +0000 Subject: [Chromoting] Add script to switch release channels. Review URL: https://codereview.chromium.org/11154023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174037 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/tools/mac/chromoting-set-channel.sh | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 remoting/tools/mac/chromoting-set-channel.sh (limited to 'remoting/tools') diff --git a/remoting/tools/mac/chromoting-set-channel.sh b/remoting/tools/mac/chromoting-set-channel.sh new file mode 100755 index 0000000..ab1e37a --- /dev/null +++ b/remoting/tools/mac/chromoting-set-channel.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e -u + +ME="$(basename "$0")" +readonly ME + +KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin +KSPID=com.google.chrome_remote_desktop + +usage() { + echo "Usage: ${ME} " >&2 + echo "where is 'beta' or 'stable'" >&2 +} + +log() { + local message="$1" + echo "${message}" + logger "${message}" +} + +checkroot() { + if [[ "$(id -u)" != "0" ]]; then + echo "This script requires root permissions" 1>&2 + exit 1 + fi +} + +main() { + local channel="$1" + + if [[ "${channel}" != "beta" && "${channel}" != "stable" ]]; then + usage + exit 1 + fi + + local channeltag="${channel}" + if [[ "${channel}" == "stable" ]]; then + channeltag="" + fi + + log "Switching Chrome Remote Desktop channel to ${channel}" + + $KSADMIN --productid "$KSPID" --tag "${channeltag}" + + if [[ "${channel}" == "stable" ]]; then + echo "You're not done yet!" + echo "You must now UNINSTALL and RE-INSTALL the latest version of Chrome" + echo "Remote Desktop to get your machine back on the stable channel." + echo "Thank you!" + else + echo "Switch to ${channel} channel complete." + echo "You will download ${channel} binaries during the next update check." + fi +} + +checkroot + +if [[ $# < 1 ]]; then + usage + exit 1 +fi + +main "$@" -- cgit v1.1