| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 set -e | 7 set -e |
| 8 | 8 |
| 9 # Product ID in crash report | 9 # Product ID in crash report |
| 10 CHROMEOS_PRODUCT=ChromeOS | 10 CHROMEOS_PRODUCT=ChromeOS |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 # This could just be an unrelated process, but it's ok to be conservative. | 87 # This could just be an unrelated process, but it's ok to be conservative. |
| 88 lecho "Already running. Exiting now." | 88 lecho "Already running. Exiting now." |
| 89 exit 1 | 89 exit 1 |
| 90 } | 90 } |
| 91 | 91 |
| 92 get_version() { | 92 get_version() { |
| 93 grep ^CHROMEOS_RELEASE_VERSION /etc/lsb-release | cut -d = -f 2- | 93 grep ^CHROMEOS_RELEASE_VERSION /etc/lsb-release | cut -d = -f 2- |
| 94 } | 94 } |
| 95 | 95 |
| 96 is_official() { | 96 is_official() { |
| 97 grep ^CHROMEOS_RELEASE_DESCRIPTION /etc/lsb-release | cut -d = -f 2- | \ | 97 grep ^CHROMEOS_RELEASE_DESCRIPTION /etc/lsb-release | grep -q Official |
| 98 grep Official | |
| 99 } | 98 } |
| 100 | 99 |
| 101 # Generate a uniform random number in 0..max-1. | 100 # Generate a uniform random number in 0..max-1. |
| 102 generate_uniform_random() { | 101 generate_uniform_random() { |
| 103 local max=$1 | 102 local max=$1 |
| 104 local random="$(od -An -N4 -tu /dev/urandom)" | 103 local random="$(od -An -N4 -tu /dev/urandom)" |
| 105 echo $((random % max)) | 104 echo $((random % max)) |
| 106 } | 105 } |
| 107 | 106 |
| 108 is_feedback_disabled() { | 107 is_feedback_disabled() { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" | 263 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" |
| 265 | 264 |
| 266 # Send system-wide crashes | 265 # Send system-wide crashes |
| 267 send_crashes "/var/spool/crash" | 266 send_crashes "/var/spool/crash" |
| 268 | 267 |
| 269 # Send user-specific crashes | 268 # Send user-specific crashes |
| 270 send_crashes "/home/chronos/user/crash" | 269 send_crashes "/home/chronos/user/crash" |
| 271 } | 270 } |
| 272 | 271 |
| 273 main | 272 main |
| OLD | NEW |