| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # URL from which the latest version of this script can be downloaded. | 6 # URL from which the latest version of this script can be downloaded. |
| 7 script_url="http://src.chromium.org/svn/trunk/src/tools/android/adb_remote_setup
.sh" | 7 # Gitiles returns the result as base64 formatted, so the result needs to be |
| 8 # decoded. See https://code.google.com/p/gitiles/issues/detail?id=7 for |
| 9 # more information about this security precaution. |
| 10 script_url="https://chromium.googlesource.com/chromium/src.git/+/master" |
| 11 script_url+="/tools/android/adb_remote_setup.sh" |
| 12 script_url+="?format=TEXT" |
| 8 | 13 |
| 9 # Replaces this file with the latest version of the script and runs it. | 14 # Replaces this file with the latest version of the script and runs it. |
| 10 update-self() { | 15 update-self() { |
| 11 local script="${BASH_SOURCE[0]}" | 16 local script="${BASH_SOURCE[0]}" |
| 12 local new_script="${script}.new" | 17 local new_script="${script}.new" |
| 13 local updater_script="${script}.updater" | 18 local updater_script="${script}.updater" |
| 14 curl -sSf -o "$new_script" "$script_url" || return | 19 curl -sSf "$script_url" | base64 --decode > "$new_script" || return |
| 15 chmod +x "$new_script" || return | 20 chmod +x "$new_script" || return |
| 16 | 21 |
| 17 # Replace this file with the newly downloaded script. | 22 # Replace this file with the newly downloaded script. |
| 18 cat > "$updater_script" << EOF | 23 cat > "$updater_script" << EOF |
| 19 #!/bin/bash | 24 #!/bin/bash |
| 20 if mv "$new_script" "$script"; then | 25 if mv "$new_script" "$script"; then |
| 21 rm -- "$updater_script" | 26 rm -- "$updater_script" |
| 22 else | 27 else |
| 23 echo "Note: script update failed." | 28 echo "Note: script update failed." |
| 24 fi | 29 fi |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 # 10201: net unittests | 95 # 10201: net unittests |
| 91 ssh -C \ | 96 ssh -C \ |
| 92 -R 5037:localhost:5037 \ | 97 -R 5037:localhost:5037 \ |
| 93 -L 8001:localhost:8001 \ | 98 -L 8001:localhost:8001 \ |
| 94 -L 9031:localhost:9031 \ | 99 -L 9031:localhost:9031 \ |
| 95 -L 9041:localhost:9041 \ | 100 -L 9041:localhost:9041 \ |
| 96 -L 9051:localhost:9051 \ | 101 -L 9051:localhost:9051 \ |
| 97 -R 10000:localhost:10000 \ | 102 -R 10000:localhost:10000 \ |
| 98 -R 10201:localhost:10201 \ | 103 -R 10201:localhost:10201 \ |
| 99 "$remote_host" | 104 "$remote_host" |
| OLD | NEW |