blob: 8e7383b6c6078d68e9c8b23cf1e3d3c3ed480266 [file] [log] [blame]
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +08001.. SPDX-License-Identifier: GPL-2.0+:
2
3wget command
4============
5
6Synopsis
7--------
8
9::
Heinrich Schuchardt311fe212022-12-22 11:32:03 +010010
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080011 wget address [[hostIPaddr:]path]
12
13Description
14-----------
15
16The wget command is used to download a file from an HTTP server.
17
18wget command will use HTTP over TCP to download files from an HTTP server.
Marek Vasut22a95082023-12-13 22:11:13 +010019By default the destination port is 80 and the source port is pseudo-random.
20The environment variable *httpdstp* can be used to set the destination port.
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080021
22address
23 memory address for the data downloaded
24
25hostIPaddr
26 IP address of the HTTP server, defaults to the value of environment
27 variable *serverip*
28
29path
30 path of the file to be downloaded.
31
32Example
33-------
34
35In 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
52Configuration
53-------------
54
55The command is only available if CONFIG_CMD_WGET=y.
56
Heinrich Schuchardt311fe212022-12-22 11:32:03 +010057TCP Selective Acknowledgments can be enabled via CONFIG_PROT_TCP_SACK=y.
58This will improve the download speed.
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080059
60Return value
61------------
62
63The return value $? is 0 (true) on success and 1 (false) otherwise.