| 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 # This attempts to guide linux users through the process of putting a recovery | 7 # This attempts to guide linux users through the process of putting a recovery |
| 8 # image onto a removeable USB drive. | 8 # image onto a removeable USB drive. |
| 9 # | 9 # |
| 10 # We may not need root privileges if we have the right permissions. | 10 # We may not need root privileges if we have the right permissions. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 url="$1" | 184 url="$1" |
| 185 filename="$2" | 185 filename="$2" |
| 186 resume="${3:-}" | 186 resume="${3:-}" |
| 187 | 187 |
| 188 DEBUG "FETCH=($FETCH) url=($url) filename=($filename) resume=($resume)" | 188 DEBUG "FETCH=($FETCH) url=($url) filename=($filename) resume=($resume)" |
| 189 | 189 |
| 190 if [ "$FETCH" = "curl" ]; then | 190 if [ "$FETCH" = "curl" ]; then |
| 191 if [ -z "$resume" ]; then | 191 if [ -z "$resume" ]; then |
| 192 # quietly fetch a new copy each time | 192 # quietly fetch a new copy each time |
| 193 rm -f "$filename" | 193 rm -f "$filename" |
| 194 curl -f -s -S -o "$filename" "$url" | 194 curl -L -f -s -S -o "$filename" "$url" |
| 195 else | 195 else |
| 196 # continue where we left off, if possible | 196 # continue where we left off, if possible |
| 197 curl -f -C - -o "$filename" "$url" | 197 curl -L -f -C - -o "$filename" "$url" |
| 198 # If you give curl the '-C -' option but the file you want is already | 198 # If you give curl the '-C -' option but the file you want is already |
| 199 # complete and the server doesn't report the total size correctly, it | 199 # complete and the server doesn't report the total size correctly, it |
| 200 # will report an error instead of just doing nothing. We'll try to work | 200 # will report an error instead of just doing nothing. We'll try to work |
| 201 # around that. | 201 # around that. |
| 202 err=$? | 202 err=$? |
| 203 if [ "$err" = "18" ]; then | 203 if [ "$err" = "18" ]; then |
| 204 warn "Ignoring spurious complaint" | 204 warn "Ignoring spurious complaint" |
| 205 true | 205 true |
| 206 fi | 206 fi |
| 207 fi | 207 fi |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 prompt "Shall I remove the temporary files now? [y/n] " | 841 prompt "Shall I remove the temporary files now? [y/n] " |
| 842 read tmp | 842 read tmp |
| 843 case $tmp in | 843 case $tmp in |
| 844 [Yy]*) | 844 [Yy]*) |
| 845 cd | 845 cd |
| 846 \rm -rf ${WORKDIR} | 846 \rm -rf ${WORKDIR} |
| 847 ;; | 847 ;; |
| 848 esac | 848 esac |
| 849 | 849 |
| 850 exit 0 | 850 exit 0 |
| OLD | NEW |