<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=2293&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] how to reboot modem from router command line?]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=2293</link>
		<description><![CDATA[The most recent posts in [SOLVED] how to reboot modem from router command line?.]]></description>
		<lastBuildDate>Sun, 11 Jun 2023 07:04:18 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=42516#p42516</link>
			<description><![CDATA[<p>Hello All,<br />First off, thanks to everyone that has contributed to this forum posting!!!!</p><p>I just wanted to contribute my solution to remotely rebooting a Netgear R7000P NightHawk Router (with latest version of firmware as of 06/09/2023 - &quot;V1.3.3.154_10.1.86&quot;).</p><p>Based on the hints and suggestions in this forum I have crafted[hacked together&#160; ;-) ] a very reliable shell script that I run on an old RPi-3 via cron to nightly reboot the router. (You may ask why am I rebooting this R7000P router, well after stupidly updating firmware to the latest version, the router has been getting into a very strange state and its web pages would no longer load or its internal webserver would just stop responding - it would still do its routing functions and even continue to operate as an OpenVPN server!).&#160; So, I tried to downgrade back to the original version of firmware and the R7000P would not allow it. In a quick attempt to solve the issue, I just chose to reboot the device every morning at 4:56am!!!!&#160; This seems to have worked...</p><p>The text of the script is here:<br />------------------------<br />#!/bin/sh<br />#<br /># Simple script to REBOOT the Netgear R7000P router via the commandline....<br />#<br /># This is based on various search results:<br />#&#160; <a href="https://dev1galaxy.org/viewtopic.php?id=2293" rel="nofollow">https://dev1galaxy.org/viewtopic.php?id=2293</a><br />#<br />#<br /># 06/09/2023<br />#<br />#</p><p># Command to login and establish my unique transaction ID...<br />MyTxNId=`/usr/bin/wget --no-check-certificate&#160; -O- -q --http-user admin --http-password YourPassword <a href="https://192.168.1.1/ADVANCED_home2.htm" rel="nofollow">https://192.168.1.1/ADVANCED_home2.htm</a> | grep &quot;form action&quot;|tr &#039;=&#039; &#039; &#039; | tr &#039;&quot;&#039; &#039; &#039; | awk &#039;{print $4}&#039;`;</p><p># The Transaction ID is defined by the R7000P router...<br />echo &quot;My Ephemeral Transaction ID from the R7000P router is: &quot;&#160; $MyTxNId</p><p>echo &quot; &quot;<br />echo &quot; &quot;</p><p># Now perform a HTTP POST operation to the &quot;hidden&quot; CGI and reboot the router...<br />echo &quot;Now issuing the ReBoot command to the R7000P!&quot;<br />/usr/bin/wget --no-check-certificate -q -O /dev/null --http-user admin --http-password YourPassword --post-data &#039;buttonSelect=2&#039; <a href="https://192.168.1.1/newgui_adv_home.cgi?id=$MyTxNId" rel="nofollow">https://192.168.1.1/newgui_adv_home.cgi?id=$MyTxNId</a></p><p>echo &quot; &quot;<br />echo &quot; &quot;</p><p># The wait is like 5 to 7 minutes to reboot!!!!<br />echo &quot;Now Wait A Few Minutes for the Router to ReBoot!!!!&quot;</p><p>echo &quot; &quot;<br />echo &quot; &quot;<br />------------------------</p><p>Note: Substitute your actual IP address (and access method - HTTP or HTTPS) of the R7000P and replace the text &quot;YourPassword&quot; with whatever your password is for your device!!!!!!&#160; Also, if you don&#039;t use HTTPS access, then you can eliminate the &quot;--no-check-certificate&quot; WGET option, it is used to prevent WGET from complaining about the self-signed SSL/TLS certificate from the R7000P router!</p><p>I hope this helps the next person that is trying to solve this reboot problem that Netgear should have incorporated into their firmware - like most other systems - or even better, support a SSH login to enable access the router&#039;s internal commandline environment!!!!</p><p>Enjoy!</p>]]></description>
			<author><![CDATA[dummy@example.com (netgear_owner)]]></author>
			<pubDate>Sun, 11 Jun 2023 07:04:18 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=42516#p42516</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11287#p11287</link>
			<description><![CDATA[<p>ralph.ronnquist, all your input gave rise to this command, which MAKES THE MODEM REBOOT <img src="http://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="codebox"><pre><code>bruno@thinkpad:~$ id=$(wget -O- --http-user admin --http-password password http://192.168.100.1/RouterStatus.htm | perl -lne &#039;/id=([0-9]+)/ &amp;&amp; print $1&#039;); wget --http-user admin --http-password password --post-data &#039;buttonSelect=2&#039; http://192.168.100.1/goform/RouterStatus?id=&quot;$id&quot;</code></pre></div><p>This is exactly the kind of elegant solution I was hoping to find.</p><p>Incidentally, the <span class="bbc">id</span> is important. If I use a random number (with the correct number of digits) or an <span class="bbc">id</span> that showed up before, it doesn&#039;t work.</p><p>I had no idea it would turn out to be this complicated, and not in a million years could I have figured this out without your tireless help and amazing skills. Thank you so much!</p><p>(BTW, both my modem and router are in hard-to-reach places. When I&#039;ve had to reboot them, it&#039;s always been a huge hassle. Now I can just push a button on my phone and it all happens automatically!)</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Mon, 13 Aug 2018 11:50:01 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11287#p11287</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11280#p11280</link>
			<description><![CDATA[<p>The &quot;confirm&quot; popup is in the <span class="bbc">RouterStatus.htm</span> script to come up before the reboot request gets issued; so it&#039;s before that <span class="bbc">wget</span> request gets issued.</p><p>When checking the file again with more care, I realized that there is the hidden input field named <span class="bbc">buttonSelect</span>. Thus that should be the name used in the post data. I.e., try using <span class="bbc">buttonSelect=2</span> instead of <span class="bbc">button=2</span>.</p><p>Since both 1.htm and 2.htm are the same progress bar response, it suggests that the id number is not very important. Thus option 1 may well work with <span class="bbc">buttonSelect=2</span>.</p><p>The complex, third, variant doesn&#039;t work at all as is, which is my fault. It should have <span class="bbc">-O-</span> instead of <span class="bbc">-v</span>; you will want the download of the inner <span class="bbc">wget</span> to go to standard output, and piped to <span class="bbc">sed</span>, which extracts the form action (with path and id) to be used by the outer <span class="bbc">wget</span>.</p><p>Though the complex variant is only needed if the id number is important. If there also is a connection to the session cookie, the command might need to be made even more complex, so as to making the inner <span class="bbc">wget</span> save the cookie, and the outer load it.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Mon, 13 Aug 2018 03:26:37 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11280#p11280</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11276#p11276</link>
			<description><![CDATA[<p>Just a thought: When I manually click on the Reboot button, I get a popup (&quot;Rebooting the gateway will disrupt active traffic on the network. Are you sure?&quot; Cancel/OK). Could it be that one or more of our <span class="bbc">wget</span> commands is successfully pressing the Reboot button but not answering &quot;OK&quot; to the popup? Maybe this is a stupid question because <span class="bbc">wget</span> requests don&#039;t trigger confirmation popups since no javascript is involved?</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Mon, 13 Aug 2018 00:35:35 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11276#p11276</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11274#p11274</link>
			<description><![CDATA[<p>I really didn&#039;t like my solution and as long as this remains interesting to you, I&#039;m committed to finding a cleaner solution.</p><p>Yes, I had noticed the unexplained <span class="bbc">id=1232362831</span> parameter. It seems to be different each time, but it is not obvious what it is. I just ran the same command I ran in post #18 and this time it was <span class="bbc">id=1823045111</span>, so it does not appear to be a timestamp.</p><p>I tried all three commands you suggested. While no errors were reported, none of the commands caused the modem to reboot. Here are the three commands and their terminal output, as well as the fetched file(s):</p><p>First command:</p><div class="codebox"><pre><code>bruno@thinkpad:~$ wget --http-user admin --http-password password --post-data &#039;button=2&#039; http://192.168.100.1/goform/RouterStatus?id=1232362831
--2018-08-12 19:58:22--  http://192.168.100.1/goform/RouterStatus?id=1232362831
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm=&quot;NETGEAR CM400&quot;
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3558 (3.5K) [text/html]
Saving to: ‘RouterStatus?id=1232362831’

RouterStatus?id=123 100%[===================&gt;]   3.47K  --.-KB/s    in 0s      

2018-08-12 19:58:22 (16.8 MB/s) - ‘RouterStatus?id=1232362831’ saved [3558/3558]</code></pre></div><p>Fetched <a href="http://files.dantas.airpost.net/public/1.htm" rel="nofollow">this</a>.</p><p>Second command:</p><div class="codebox"><pre><code>bruno@thinkpad:~$ wget --http-user admin --http-password password --post-data &#039;button=2&#039; http://192.168.100.1/goform/RouterStatus?id=$(( $(date +%s) - 301751682))
--2018-08-12 19:59:08--  http://192.168.100.1/goform/RouterStatus?id=1232366666
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm=&quot;NETGEAR CM400&quot;
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3558 (3.5K) [text/html]
Saving to: ‘RouterStatus?id=1232366666’

RouterStatus?id=123 100%[===================&gt;]   3.47K  --.-KB/s    in 0s      

2018-08-12 19:59:08 (91.2 MB/s) - ‘RouterStatus?id=1232366666’ saved [3558/3558]</code></pre></div><p>Fetched <a href="http://files.dantas.airpost.net/public/2.htm" rel="nofollow">this</a>.</p><p>Third command:</p><div class="codebox"><pre><code>bruno@thinkpad:~$ wget --http-user admin --http-password password --post-data &#039;button=2&#039; http://192.168.100.1$(wget -v --http-user admin --http-password password http://192.168.100.1/RouterStatus.htm | sed &#039;/action/ s/.*n=&quot;\([^&quot;]*\).*/\1/&#039;)
--2018-08-12 20:08:19--  http://192.168.100.1/RouterStatus.htm
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm=&quot;NETGEAR CM400&quot;
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50638 (49K) [text/html]
Saving to: ‘RouterStatus.htm’

RouterStatus.htm    100%[===================&gt;]  49.45K  --.-KB/s    in 0.03s   

2018-08-12 20:08:19 (1.52 MB/s) - ‘RouterStatus.htm’ saved [50638/50638]

--2018-08-12 20:08:19--  http://192.168.100.1/
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm=&quot;NETGEAR CM400&quot;
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52037 (51K) [text/html]
Saving to: ‘index.html’

index.html          100%[===================&gt;]  50.82K  --.-KB/s    in 0.02s   

2018-08-12 20:08:19 (2.10 MB/s) - ‘index.html’ saved [52037/52037]</code></pre></div><p>Fetched <a href="http://files.dantas.airpost.net/public/3.htm" rel="nofollow">this</a> and <a href="http://files.dantas.airpost.net/public/index.htm" rel="nofollow">this</a>.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Mon, 13 Aug 2018 00:19:57 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11274#p11274</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11273#p11273</link>
			<description><![CDATA[<p>From a glance into the html page, it should work nicely with a single request like the following:</p><div class="codebox"><pre><code>wget --http-user admin --http-password password --post-data &#039;button=2&#039; http://192.168.100.1/goform/RouterStatus?id=1232362831</code></pre></div><p>However, that extra parameter <span class="bbc">id=1232362831</span> was generated for the page you saved, and it&#039;s not obvious how to make it up if it&#039;s different each time. It could possibly be a timestamp, if your modem&#039;s clock is off by 9 years or so. It might also be without special significance.</p><p>If it is a time stamp for an off clock, you&#039;d generate a new one with something like&#160; <span class="bbc">$(( $(date +%s) - 301751682)) </span></p><p>If it is significant, you will need to first get the page (as you did), and then pick the form action from it (e.g. with <span class="bbc">sed</span>). You would then put these two <span class="bbc">wget</span> together into a single command line like the following (where back-slash is immediately followed by new-line), perhaps:</p><div class="codebox"><pre><code>wget --http-user admin --http-password password --post-data &#039;button=2&#039; \
    http://192.168.100.1$(wget -v --http-user admin --http-password password \
       http://192.168.100.1/RouterStatus.htm | sed &#039;/action/ s/.*n=&quot;\([^&quot;]*\).*/\1/&#039;)</code></pre></div><p>On the other hand, since your method works, you might as well keep that.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Sun, 12 Aug 2018 23:18:36 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11273#p11273</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11271#p11271</link>
			<description><![CDATA[<p>@ralph.ronnquist: Things are looking good for <span class="bbc">wget</span>.</p><p>First, I noticed that typing &quot;<a href="http://192.168.100/RouterStatus.htm" rel="nofollow">http://192.168.100/RouterStatus.htm</a>&quot; in my webbrowser takes me directly to the page on the modem with the Reboot button.</p><p>Then, I tried this <span class="bbc">wget</span> command and noticed that after initial &quot;401 Unauthorized&quot; error, authentication succeeds:</p><div class="codebox"><pre><code>bruno@thinkpad:~$ wget -v --http-user admin --http-password password &quot;http://192.168.100.1/RouterStatus.htm&quot;
--2018-08-12 16:19:17--  http://192.168.100.1/RouterStatus.htm
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm=&quot;NETGEAR CM400&quot;
Connecting to 192.168.100.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50638 (49K) [text/html]
Saving to: ‘RouterStatus.htm’

RouterStatus.htm    100%[===================&gt;]  49.45K  --.-KB/s    in 0.03s   

2018-08-12 16:19:17 (1.68 MB/s) - ‘RouterStatus.htm’ saved [50638/50638]</code></pre></div><p>If you&#039;d like to see what &quot;RouterStatus.htm&quot; looks like, it is <a href="http://files.dantas.airpost.net/public/RouterStatus.htm" rel="nofollow">here</a>.</p><p>The missing piece is to add something to the command that sends the appropriate button press. Any ideas?</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sun, 12 Aug 2018 20:23:46 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11271#p11271</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11266#p11266</link>
			<description><![CDATA[<p>Thanks for the suggestion, ralph.ronnquist. I tried searching for the Reboot button using <span class="bbc">form[0]</span> instead of <span class="bbc">form[1]</span> in the xpath, but no luck. </p><p>I gave up finding the Reboot button the &quot;proper&quot; way. For the step where Reboot button is pressed, I decided to cheat and use <span class="bbc">xdotool</span> to simply click at the button&#039;s coordinates on the screen. So this is the kludge of a script I came up with to reboot my modem from the command line:</p><div class="codebox"><pre><code>#!/usr/bin/python

from selenium import webdriver
import time
import os

browser = webdriver.Firefox()
browser.get(&#039;http://admin:password@192.168.100.1/&#039;)
time.sleep(5)
alert = browser.switch_to_alert()
alert.accept()
time.sleep(5)
advancedTab = browser.find_element_by_link_text(&#039;ADVANCED&#039;)
advancedTab.click()
time.sleep(5)
os.system(&#039;xdotool mousemove --sync 650 420; xdotool click --repeat 1 --delay 125 1&#039;)
time.sleep(5)
alert = browser.switch_to_alert()
alert.accept() </code></pre></div><p>I find my solution ugly to the point of being offensive, but it will tide me over until I find something better--an excursion into <span class="bbc">wget</span> is definitely in order. If I discover something elegant, I&#039;ll make sure to post it here.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sun, 12 Aug 2018 19:20:16 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11266#p11266</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11260#p11260</link>
			<description><![CDATA[<p>My read buffer for python is rather limited I&#039;m afraid, but I noticed you&#039;re using <span class="bbc">form[1]</span> and that the javascript in post #10 submits a <span class="bbc">form[0]</span>. I know javascript starts indexing from 0, and if python does the same, it might mean that the submitted form is actually a hidden element prior to the visible form. Perhaps there is a &quot;tag name&quot; selector in selenium offering the array of forms, to let you mimic the <span class="bbc">index==3</span> action.</p><p>Other than that, I think I&#039;m out of ideas (well, suggesting an excursion with <span class="bbc">wget</span>, perhaps, which also is cookie capable).</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Sun, 12 Aug 2018 12:34:44 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11260#p11260</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11259#p11259</link>
			<description><![CDATA[<p>I was unable to make any progress with <span class="bbc">curl</span>, but was able to make progress using <span class="bbc">python</span> and its <span class="bbc">selenium</span> module:</p><div class="codebox"><pre><code>#!/usr/bin/python

import time
from selenium import webdriver

browser = webdriver.Firefox()
browser.get(&#039;http://admin:password@192.168.100.1/&#039;)
time.sleep(5)
alert = browser.switch_to_alert()
alert.accept()
time.sleep(5)
advancedTab = browser.find_element_by_xpath(&#039;/html/body/table/tbody/tr/td[2]/table[2]/tbody/tr/td/ul/li[2]/a/span&#039;)
advancedTab.click()
time.sleep(5)
rebootButon = browser.find_element_by_xpath(&#039;/html/body/form[1]/div/div/div/table/tbody/tr[1]/td/div/div[1]/table/tbody/tr/td/table/tbody/tr[10]/td/button[2]&#039;)
rebootButton.click()</code></pre></div><p>This script gets me to the second screenshot in post #7. It then gets stuck at the next to last line because while the Reboot button is clearly visible to me (I can hover over it, view its attributes, copy its xpath and, of course, manually click it if I want), selenium cannot find the Reboot button. I tried many of the browser&#039;s <span class="bbc">find_element_by_*</span> methods, trying to match on all of the button&#039;s attributes I could think of. There must be something very strange about how the modem&#039;s web interface was put together. Any ideas, or should I ask in a python/selenium forum?</p><p>P.S. I did some searches on how to trigger an <span class="bbc">onclick</span> function (<span class="bbc">advButtonClick(2)</span> in this case) in selenium without actually clicking the button, and did not find anything.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sun, 12 Aug 2018 11:34:58 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11259#p11259</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11244#p11244</link>
			<description><![CDATA[<div class="quotebox"><cite>GNUser wrote:</cite><blockquote><div><p>Wow, ralph.ronnquist, you know your stuff.</p></div></blockquote></div><p>He is a digital ninja.</p>]]></description>
			<author><![CDATA[dummy@example.com (golinux)]]></author>
			<pubDate>Sat, 11 Aug 2018 23:02:15 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11244#p11244</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11243#p11243</link>
			<description><![CDATA[<p>Wow, ralph.ronnquist, you know your stuff. Thank you so much for all you help so far.</p><p>There are a lot of tips in your post. Hopefully somewhere in this treasure trove I will find the answer. I&#039;ll try different things based on your guidance and will report back when I hit a snag or find a solution.</p><p>(Incidentally, I never thought the answer to my question would be so complicated. On the one hand it is stressful. On the other hand, it forces me to learn some new things.)</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sat, 11 Aug 2018 22:57:38 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11243#p11243</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11242#p11242</link>
			<description><![CDATA[<p>Firstly about the authentication: it appears the modem uses cookies for session tracking; you see the <span class="bbc">Set-Cookie</span> response header. That&#039;s slightly unfortunate as it might even mean you need to chain it all as two requests. Or maybe not. With curl, you use argument <span class="bbc">-b</span> to tell it that cookies are in use, and <span class="bbc">-c x</span> to store cookies in file <span class="bbc">x</span> (and reuse from there).</p><p>Secondly about the URL. You will need to look into the HTML for the first <span class="bbc">&lt;form .. action=...&gt;</span> and make note of its action. If that is a relative path, it would be appended to <span class="bbc">/goform</span>. Thereafter you need to add the query parameter <span class="bbc">?bbb=3</span>, although that <span class="bbc">bbb</span> you will find as the name of the button in the form. Or try with <span class="bbc">?buttonSelect=3</span> (although that looks too easy). Also, if the form method is &quot;POST&quot; you may need to make it all a POST request rather, and then the query parameter would be added into the &quot;data&quot; part.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Sat, 11 Aug 2018 22:44:15 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11242#p11242</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11239#p11239</link>
			<description><![CDATA[<p>I also tried <span class="bbc">curl</span> with <span class="bbc">--anyauth</span>, still no luck:</p><div class="codebox"><pre class="vscroll"><code>bruno@thinkpad:~$ curl --verbose --anyauth --user &quot;admin:password&quot; http://192.168.100.1/goform/RouterStatus
*   Trying 192.168.100.1...
* TCP_NODELAY set
* Connected to 192.168.100.1 (192.168.100.1) port 80 (#0)
&gt; GET /goform/RouterStatus HTTP/1.1
&gt; Host: 192.168.100.1
&gt; User-Agent: curl/7.52.1
&gt; Accept: */*
&gt; 
&lt; HTTP/1.1 401 Unauthorized
&lt; WWW-Authenticate: Basic realm=&quot;NETGEAR CM400&quot;
&lt; Server: NET-DK/1.0
&lt; Date: Sat, 11 Aug 2018 14:41:54 GMT
&lt; Set-Cookie: XSRF_TOKEN=3290479476; Path=/
&lt; Content-Type: text/html
&lt; Connection: close
&lt; Pragma: no-cache
&lt; 
* Curl_http_done: called premature == 0
* Closing connection 0
* Issue another request to this URL: &#039;http://192.168.100.1/goform/RouterStatus&#039;
* Hostname 192.168.100.1 was found in DNS cache
*   Trying 192.168.100.1...
* TCP_NODELAY set
* Connected to 192.168.100.1 (192.168.100.1) port 80 (#1)
* Server auth using Basic with user &#039;admin&#039;
&gt; GET /goform/RouterStatus HTTP/1.1
&gt; Host: 192.168.100.1
&gt; Authorization: Basic YWRtaW46RXVjbGlka2s=
&gt; User-Agent: curl/7.52.1
&gt; Accept: */*
&gt; 
&lt; HTTP/1.1 401 Unauthorized
* Authentication problem. Ignoring this.
&lt; WWW-Authenticate: Basic realm=&quot;NETGEAR CM400&quot;
&lt; Server: NET-DK/1.0
&lt; Date: Sat, 11 Aug 2018 14:41:54 GMT
&lt; Set-Cookie: XSRF_TOKEN=3290479476; Path=/
&lt; Content-Type: text/html
&lt; Connection: close
&lt; Pragma: no-cache
&lt; 
&lt;HTML&gt;
&lt;HEAD&gt;&lt;TITLE&gt;401 Unauthorized&lt;/TITLE&gt;&lt;/HEAD&gt;
&lt;/HTML&gt;&lt;HR&gt;
Error: 401 Unauthorized&lt;/TITLE&gt;&lt;/HEAD&gt;
* Curl_http_done: called premature == 0
* Closing connection 1</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sat, 11 Aug 2018 19:10:59 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11239#p11239</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] how to reboot modem from router command line?]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=11238#p11238</link>
			<description><![CDATA[<p>I saved all the html code of the modem&#039;s web interface (from Firefox&#039;s File -&gt; Save page as -&gt; Web page, complete), and found this in the <span class="bbc">RouterStatus.html</span> file (note the code under <span class="bbc">index==2</span>):</p><div class="codebox"><pre><code>function advButtonClick(index){

    if(index==0) // Show Statistics
        openStatisticsWindow();
    else if(index==1)
    {    
        openStatusWindow();
		// document.forms[0].buttonSelect.value=&quot;1&quot;;
    }
    else if(index==2)
    {
        if(confirm(&quot;Rebooting the gateway will disrupt active traffic on the network. Are you sure?&quot;))
        {
            document.forms[0].buttonSelect.value=&quot;2&quot;;
            document.forms[0].submit(document.forms[0]);
        }
    }
	else if (index==3)
	{
		if(confirm(&quot;Loading the factory default settings will erase all the current settings. Are you sure?&quot;))
        {
            document.forms[0].buttonSelect.value=&quot;3&quot;;
            document.forms[0].submit(document.forms[0]);
        }
	}
}</code></pre></div><p>If anyone knows how to trigger the reboot function (including authenticating and answering in the affirmative the &quot;are you sure?&quot; question) from the command line, I would buy you a case of beer <img src="http://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /> I&#039;m totally stuck at this point, as I know relatively little about web design and, besides, I don&#039;t understand why <span class="bbc">curl</span> fails to authenticate given that the username and password are definitely correct.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Sat, 11 Aug 2018 18:48:51 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=11238#p11238</guid>
		</item>
	</channel>
</rss>
