Posted: Tue Oct 08, 2019 19:54 Post subject: Is the Control Panel's "Command Shell" broken?
I've installed build 41027 on a new Linksys WRT3200ACM, and I try to configure it. The Administration/Commands page only shows a "Command Shell" box containing the "Commands" area. If I type a command (ps, for instance) and click the "RunCommands" button, I get the "Processing ..." pop-up but then nothing happens after that, the output of the command isn't shown.
For my IT stuff I'm using an old PC running Windows XP (2003, actually), and I have tried all the browsers that are available for it: Chrome, Firefox, Opera (both ancient and modern).
So, my question is if the "Command Shell" control is broken just for my setup, or is it some bug? In either case, can I do something to make it work?
I know that I can use PuTTY to do command-line stuff, but, for simple commands, the browser's interface is quite handy.
And two more observations, most likely unrelated (I might start/use different threads for them if this is true):
1. Trying to activate JFFS2 with the Control Panel (as shown in the JFFS Wiki) failed. Further investigation has shown that it didn't set jffs_mounted=1 in nvram (all the other associated variables were properly set). Setting it "by hand" fixed the problem.
2. I tried to load the 41174 firmware from the original Linksys console ... the router went into a reset loop that required the "three power offs" method to get out of it.
Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Wed Oct 09, 2019 1:28 Post subject:
No definitive answer here to your question about the Commands window except to say that people here generally use PuTTY (from Windows) or ssh (from linux) to access the router's command-line interface (CLI). I use ssh and have things sufficiently automated on my laptop that to do it that way is far faster and easier for me than going into the GUI and fooling with the Commands window, especially as I know of no way to see the latter's output either!
I saw at least one recent forum comment warning against using the Commands window. Perhaps this was simply because there is no way to see the output. Perhaps there is more to it. I don't know. _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
... I use ssh and have things sufficiently automated on my laptop that to do it that way is far faster and easier for me than going into the GUI and fooling with the Commands window, especially as I know of no way to see the latter's output either!
I saw at least one recent forum comment warning against using the Commands window. Perhaps this was simply because there is no way to see the output. Perhaps there is more to it. I don't know.
Thank you very much for the quick answer. I assume your setup is way past Windows XP.
I also am a happy PuTTY user, but for some things, such as adding a few firewall rules at the initial setup, it seemed the web interface was the easier way to go. But when I saw, on the web, screenshots with the command output showing on that page, and I read a few comments on browser-related firmware update issues, I suddenly didn't trust my ancient "admin PC" setup anymore. Thanks for letting me know that this actually is a (more or less) known issue.
I should probably raise a ticket for that ... and another one for the JFFS setup problem.
Well, that was kind of extreme ... I would've naturally used CLI for that.
bushant wrote:
Better to be safe and use CLI unless Save Startup, Save Shutdown, and (after testing with CLI) Save Firewall.
I am reasonably skilled in IT, but get no pleasure from doing it. I am an "old school" developer, and I prefer to do this kind of activity very well once, and then forget about it. A well designed and properly working (trustworthy) web interface helps with this approach. I don't have a problem with CLI and scripts, it's just that I have to document this stuff well enough so that a few years down the road I can understand what I have done and why ... and this is extra work.
Joined: 18 Mar 2014 Posts: 12882 Location: Netherlands
Posted: Wed Oct 09, 2019 14:53 Post subject:
I also do not use the GUI to run commands but putty.
Simple commands should run and you should see output (at least I checked with one of the latest builds for my R6400v1)
The problem is that a lot of characters have to be escaped and if they have to be escaped already you have to do a double escape.
So that is really annoying and not worth the hassle.
and yes some browsers work better then others.
Bottom line do not do it
Edit: I knew I had some line somewhere where I did that.
this is the rule which should run and can run when used with CLI/Putty
Code:
for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done
This is the rule if you would run it from the GUI command:
Code:
for line in \`nvram show \| grep =\$ \`; do var=\$\{line\%*=\}; nvram unset \$var; done
Simple commands should run and you should see output (at least I checked with one of the latest builds for my R6400v1)
Could you tell me what build is the one that works for you? This way I can try it and get a definitive answer on my ability to properly use a Windows XP PC to do web admin work on DD-WRT.
egc wrote:
The problem is that a lot of characters have to be escaped and if they have to be escaped already you have to do a double escape.
So that is really annoying and not worth the hassle.
Good to know (and to avoid). Your example is one for which I would definitely go straight to CLI.
UPDATE: Looking at the output of nvram show, I noticed something weird and did some tests.
The Command Shell actually displays the output of (most - see below) executed command(s) UNLESS the command text contains '^M's (the additional end of line character specific to Windows)! So if you type ps without pressing [Enter] after it, and click [Run Commands], the output is shown. If, however, you press [Enter] and then click [Run Commands], the output is hidden, even if the command was actually executed. Linux users should not have this problem.
If one needs to write multiple commands in the "Command Shell" box in a Windows environment, a trick that seems to work is to end each line with a '#' (it kind of comments out the '^M'). To see the '^M's, execute (in Putty) the command
Code:
nvram show | less
(all the other "usual" commands are silently ignoring them). An interesting fact is that the '^M's are also saved as part of the "additional dnsmasq options" (but dnsmasq is smart enough to ignore them), but ARE REMOVED when saving a startup script. This means that the web GUI has the tools to clean them up, but is just not using them in some cases.
I tried a dummy 'nvram set' and it worked, but I had to check its result in PuTTY, because 'nvram get' and 'nvram show' still didn't display any output, even if [Enter] was not pressed ... weird, but this looks more as a bug.
Also, a strange thing is that the last contents of the "Commands" box is stored in nvram as the value of the 'ping_ip' variable ... probably some legacy artifact.
egc wrote:
I just checked and this router uses DD-WRT v3.0-r41218 std (10/01/19)
Thanks, I was planning to install 41218 later today.
I just checked and this router uses DD-WRT v3.0-r41218 std (10/01/19)
Thanks, I was planning to install 41218 later today.
I installed 41218 and the Command Shell behaves exactly as in 41027. I'd like to raise a ticket ... could someone confirm that the behaviour I described in my "Update", above, occurs if the DD-WRT web control panel is accessed from a modern Windows and browser?