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