aboutsummaryrefslogtreecommitdiff
path: root/doc/usage/cmd/wget.rst
blob: 8e7383b6c6078d68e9c8b23cf1e3d3c3ed480266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.. SPDX-License-Identifier: GPL-2.0+:

wget command
============

Synopsis
--------

::

    wget address [[hostIPaddr:]path]

Description
-----------

The wget command is used to download a file from an HTTP server.

wget command will use HTTP over TCP to download files from an HTTP server.
By default the destination port is 80 and the source port is pseudo-random.
The environment variable *httpdstp* can be used to set the destination port.

address
    memory address for the data downloaded

hostIPaddr
    IP address of the HTTP server, defaults to the value of environment
    variable *serverip*

path
    path of the file to be downloaded.

Example
-------

In the example the following steps are executed:

* setup client network address
* download a file from the HTTP server

::

    => setenv autoload no
    => dhcp
    BOOTP broadcast 1
    *** Unhandled DHCP Option in OFFER/ACK: 23
    *** Unhandled DHCP Option in OFFER/ACK: 23
    DHCP client bound to address 192.168.1.105 (210 ms)
    => wget ${loadaddr} 192.168.1.254:/index.html
    HTTP/1.0 302 Found
    Packets received 4, Transfer Successful

Configuration
-------------

The command is only available if CONFIG_CMD_WGET=y.

TCP Selective Acknowledgments can be enabled via CONFIG_PROT_TCP_SACK=y.
This will improve the download speed.

Return value
------------

The return value $? is 0 (true) on success and 1 (false) otherwise.