Ying-Chun Liu (PaulLiu) | bfce0ca | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | wget command |
| 4 | ============ |
| 5 | |
| 6 | Synopsis |
| 7 | -------- |
| 8 | |
| 9 | :: |
| 10 | wget address [[hostIPaddr:]path] |
| 11 | |
| 12 | Description |
| 13 | ----------- |
| 14 | |
| 15 | The wget command is used to download a file from an HTTP server. |
| 16 | |
| 17 | wget command will use HTTP over TCP to download files from an HTTP server. |
| 18 | Currently it can only download image from an HTTP server hosted on port 80. |
| 19 | |
| 20 | address |
| 21 | memory address for the data downloaded |
| 22 | |
| 23 | hostIPaddr |
| 24 | IP address of the HTTP server, defaults to the value of environment |
| 25 | variable *serverip* |
| 26 | |
| 27 | path |
| 28 | path of the file to be downloaded. |
| 29 | |
| 30 | Example |
| 31 | ------- |
| 32 | |
| 33 | In the example the following steps are executed: |
| 34 | |
| 35 | * setup client network address |
| 36 | * download a file from the HTTP server |
| 37 | |
| 38 | :: |
| 39 | |
| 40 | => setenv autoload no |
| 41 | => dhcp |
| 42 | BOOTP broadcast 1 |
| 43 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 44 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 45 | DHCP client bound to address 192.168.1.105 (210 ms) |
| 46 | => wget ${loadaddr} 192.168.1.254:/index.html |
| 47 | HTTP/1.0 302 Found |
| 48 | Packets received 4, Transfer Successful |
| 49 | |
| 50 | Configuration |
| 51 | ------------- |
| 52 | |
| 53 | The command is only available if CONFIG_CMD_WGET=y. |
| 54 | |
| 55 | CONFIG_PROT_TCP_SACK can be turned on for the TCP SACK options. This will |
| 56 | help increasing the downloading speed. |
| 57 | |
| 58 | Return value |
| 59 | ------------ |
| 60 | |
| 61 | The return value $? is 0 (true) on success and 1 (false) otherwise. |