Help with wget script please?
Posted: 14 Nov 2008, 14:41
Hi all
This is a general Linux query really, but thought I’d ask you guys.
I'm trying to put together a small script on my bubba to retrieve connection info from my router.
The problem I'm having is that the script fails due to authorization the first time round, but if I try it again, it works. Any ideas to why this would happen?
Heres the results of my wget's:
Many Thanks
Gary
.
This is a general Linux query really, but thought I’d ask you guys.
I'm trying to put together a small script on my bubba to retrieve connection info from my router.
The problem I'm having is that the script fails due to authorization the first time round, but if I try it again, it works. Any ideas to why this would happen?
Heres the results of my wget's:
Code: Select all
gary@bubba:~$ wget --http-user=myuser --http-passwd=password --output-document=/home/gary/public_html/index.html http://192.168.0.1/setup.cgi?next_file=stattbl.htm
--19:13:35-- http://192.168.0.1/setup.cgi?next_file=stattbl.htm
=> `/home/gary/public_html/index.html'
Connecting to 192.168.0.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
gary@bubba:~$
Code: Select all
gary@bubba:~$ wget --http-user=myuser --http-passwd=password --output-document=/home/gary/public_html/index.html http://192.168.0.1/setup.cgi?next_file=stattbl.htm
--19:14:37-- http://192.168.0.1/setup.cgi?next_file=stattbl.htm
=> `/home/gary/public_html/index.html'
Connecting to 192.168.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
[ <=> ] 4,735 --.--K/s
19:14:38 (41.36 KB/s) - `/home/gary/public_html/index.html' saved [4735]
gary@bubba:~$
Gary
.