Ying-Chun Liu (PaulLiu) | 2dbb7a4 | 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 | :: |
Heinrich Schuchardt | 311fe21 | 2022-12-22 11:32:03 +0100 | [diff] [blame] | 10 | |
Ying-Chun Liu (PaulLiu) | 2dbb7a4 | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 11 | wget address [[hostIPaddr:]path] |
| 12 | |
| 13 | Description |
| 14 | ----------- |
| 15 | |
| 16 | The wget command is used to download a file from an HTTP server. |
| 17 | |
| 18 | wget command will use HTTP over TCP to download files from an HTTP server. |
Marek Vasut | 22a9508 | 2023-12-13 22:11:13 +0100 | [diff] [blame^] | 19 | By default the destination port is 80 and the source port is pseudo-random. |
| 20 | The environment variable *httpdstp* can be used to set the destination port. |
Ying-Chun Liu (PaulLiu) | 2dbb7a4 | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 21 | |
| 22 | address |
| 23 | memory address for the data downloaded |
| 24 | |
| 25 | hostIPaddr |
| 26 | IP address of the HTTP server, defaults to the value of environment |
| 27 | variable *serverip* |
| 28 | |
| 29 | path |
| 30 | path of the file to be downloaded. |
| 31 | |
| 32 | Example |
| 33 | ------- |
| 34 | |
| 35 | In the example the following steps are executed: |
| 36 | |
| 37 | * setup client network address |
| 38 | * download a file from the HTTP server |
| 39 | |
| 40 | :: |
| 41 | |
| 42 | => setenv autoload no |
| 43 | => dhcp |
| 44 | BOOTP broadcast 1 |
| 45 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 46 | *** Unhandled DHCP Option in OFFER/ACK: 23 |
| 47 | DHCP client bound to address 192.168.1.105 (210 ms) |
| 48 | => wget ${loadaddr} 192.168.1.254:/index.html |
| 49 | HTTP/1.0 302 Found |
| 50 | Packets received 4, Transfer Successful |
| 51 | |
| 52 | Configuration |
| 53 | ------------- |
| 54 | |
| 55 | The command is only available if CONFIG_CMD_WGET=y. |
| 56 | |
Heinrich Schuchardt | 311fe21 | 2022-12-22 11:32:03 +0100 | [diff] [blame] | 57 | TCP Selective Acknowledgments can be enabled via CONFIG_PROT_TCP_SACK=y. |
| 58 | This will improve the download speed. |
Ying-Chun Liu (PaulLiu) | 2dbb7a4 | 2022-11-08 14:17:30 +0800 | [diff] [blame] | 59 | |
| 60 | Return value |
| 61 | ------------ |
| 62 | |
| 63 | The return value $? is 0 (true) on success and 1 (false) otherwise. |