Is the Control Panel's "Command Shell" broken?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Tue Oct 08, 2019 19:54    Post subject: Is the Control Panel's "Command Shell" broken? Reply with quote
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.
Sponsor
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Wed Oct 09, 2019 1:28    Post subject: Reply with quote
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.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Wed Oct 09, 2019 1:52    Post subject: Reply with quote
As well as there are some things that should NOT be done in GUI command window.
From <Kong>:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1149164#1149164

Better to be safe and use CLI unless Save Startup, Save Shutdown, and (after testing with CLI) Save Firewall.

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad (1.1M blocked) + Blocklist Collection

VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Wed Oct 09, 2019 2:07    Post subject: Reply with quote
SurprisedItWorks wrote:
... 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.
VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Wed Oct 09, 2019 2:24    Post subject: Reply with quote
bushant wrote:
As well as there are some things that should NOT be done in GUI command window.
From <Kong>:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1149164#1149164

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.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12882
Location: Netherlands

PostPosted: Wed Oct 09, 2019 14:53    Post subject: Reply with quote
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 Smile


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


you see my point Very Happy

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Wed Oct 09, 2019 15:07    Post subject: Reply with quote
Thanks for the answer.
egc wrote:
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.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12882
Location: Netherlands

PostPosted: Wed Oct 09, 2019 15:17    Post subject: Reply with quote
I just checked and this router uses DD-WRT v3.0-r41218 std (10/01/19)
I use Firefox as my browser but update with Internet Explorer (that is the one which always works Smile )

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Wed Oct 09, 2019 18:05    Post subject: Reply with quote
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.
VladD
DD-WRT Novice


Joined: 05 Sep 2019
Posts: 6

PostPosted: Wed Oct 09, 2019 20:37    Post subject: Reply with quote
VladD wrote:
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 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?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum