Question

I have an IP camera and the link below takes a snap shot and show you the picture in your broswer:

http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888

I am trying to write a script, using wget to download a snap shot to my local repeatably after a certain period. However, when i use

wget -m -p -k http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888

I get the following respond:

 => `192.168.5.10:81/snapshot.cgi?user=admin'
Connecting to 192.168.5.10:81... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.5.10:81... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

The password part got truncated somehow, that is why i get 401 unauthorized problem. I think it is an easy problem to solve, but I am new to linux, any sugguestions how to fix this?

Thanks in advance

Was it helpful?

Solution

You must enclose the URL in double quotes to prevent the ampersand & from being interpreted by the shell. I.e.

wget -m -p -k "http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top