I read from this page how to restart the router using curl.
I got the command for my router
http://192.168.1.1/Forms/tools_system_1?restoreFlag=0&Restart=RESTART
It works when i put it in browser's address bar but when I use curl
curl -u admin:mypass 'http://192.168.1.1/Forms/tools_system_1?restoreFlag=0&Restart=RESTART'
It does not work.
no output is there in Terminal Screen.
EDIT
Result of --
curl -i -u admin:mypass 'http://192.168.1.1/Forms/tools_system_1?restoreFlag=0&Restart=RESTART'
gives this--
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="450TC1"
Content-Type: text/html
Transfer-Encoding: chunked
Server: RomPager/4.07 UPnP/1.0
EXT:
<html>
<head>
<title>Protected Object</title></head><body>
<h1>Protected Object</h1>This object on the RomPager server is protected
Output of
curl --verbose -u admin:mypass 'http://192.168.1.1/Forms/tools_system_1?restoreFlag=0&Restart=RESTART'
Gives this --
* About to connect() to 192.168.1.1 port 80 (#0)
* Trying 192.168.1.1... connected
* Server auth using Basic with user 'admin'
> GET /Forms/tools_system_1?restoreFlag=0&Restart=RESTART HTTP/1.1
> Authorization: Basic YWRtaW46c2hhcmluZ2FuMDA3
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.1.1
> Accept: */*
>
< HTTP/1.1 303 See Other
< Location: http://192.168.1.1/progress.htm
< Content-Length: 0
< Server: RomPager/4.07 UPnP/1.0
< EXT:
<
* Connection #0 to host 192.168.1.1 left intact
* Closing connection #0
But curl -u admin:mypass 192.168.1.1
returns this. Works fine!
<html>
<head>
<title>
</title><meta http-equiv="Content-Type" content="text/html; charset=
iso-8859-1">
<meta http-equiv=Content-Script-Type content=text/javascript>
<meta http-equiv=Content-Style-Type content=text/css>
</head><frameset rows="65,75,*" framespacing="0" border="0" frameborder="0">
<frame name="header" noresize src="status.html" marginwidth="0" marginheight="0">
<frame name="navigation" noresize src="navigation-status.html" marginwidth="0" marginheight="0">
<frame name="main" noresize src="../status/status_deviceinfo.htm" marginwidth="0" marginheight="0">
</frameset><noframes>
</noframes>
</html>
curl
with additional switches, like-i
and--verbose
, e.g.curl -i -u admin:mypass 'http://…
etc. The router doesn't return any content in body, you should investigate HTTP headers instead; add output of these commands to your question so we can better understand what's going on. It's possible the router doesn't accept HTTP authentication and uses cookies instead. Or maybe the router accepts only the POST request for this command.