문제

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

도움이 되었습니까?

해결책

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top