【发布时间】:2014-11-30 04:10:34
【问题描述】:
我正在尝试使用 wget/curl 编写从 Internet 下载信息的脚本。我连接到 Cisco/Linksys wifi 路由器上的“访客”网络,该路由器要求我提供密码才能访问互联网。
我尝试将用于管理员帐户的用户/密码传递给路由器,但当我执行类似...
$ wget -O- --user=admin --password=qwerty librivox.org
--2014-11-29 20:05:04-- http://librivox.org/
Resolving librivox.org... 208.70.31.70
Connecting to librivox.org|208.70.31.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'
[<=> ] 0 --.-K/s
<html><head><noscript><meta http-equiv=Refresh Content="0;
URL=http://192.168.3.1:10080/ui/dynamic/guest-login.html"></noscript><script language='javascript' type='text/javascript'>function init(_frm) { if (_frm.sent.value == 0) { _frm.sent.value=1; _frm.submit(); } }</script></head>
<body onload=init(auth)>
<form name=auth action='http://192.168.3.1:10080/ui/dynamic/guest-login.html' METHOD=GET>
<input type=hidden name='mac_addr' value='00:xx:xx:xx:xx:xx'>
<input type=hidden name='url' value='http://librivox.org/'>
<input type=hidden name='ip_addr' value='192.168.3.136'>
[ <=> ] 634 --.-K/s in 0s
2014-11-29 20:05:05 (24.3 MB/s) - written to stdout [634]
...我应该如何从 bash 脚本中提供该密码?
谢谢
【问题讨论】: