Multiple entries in "Commands" window disables but

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message
resolv
DD-WRT Novice


Joined: 19 Apr 2021
Posts: 24

PostPosted: Mon Apr 19, 2021 23:24    Post subject: Multiple entries in "Commands" window disables but Reply with quote
Hello,

Hardware and firmware:
Linksys WRT3200ACM
DD-WRT v3.0-r44715 std (11/03/20)

Using "Administration tab -> Commands subtab"; if I enter multiple commands to configure static leases,
then under "Services tab -> Services subtab", the "Save", "Apply Settings", and "Reboot Router" buttons all stop responding.
But if I enter these commands one-at-a-time, then these buttons all work/respond.

Example #1: enter commands all-at-once
Administration tab -> Commands subtab
Commands window:
Code:
nvram set static_leasenum=1
nvram set static_leases=A1:A1:A1:A1:A1:A1=Computer=192.168.1.11=1440
nvram commit

Run Commands

Services tab -> Services subtab
Change the "Client Lease Expiration" to "720" minutes.
click "Save" button <- NO RESPONSE
click "Apply Settings" button <- NO RESPONSE
click "Reboot Router" button <- NO RESPONSE

But if I enter the commands one-at-a-time, then the buttons all work.

Example #2: enter commands one-at-a-time
Administration tab -> Commands subtab
Commands window:
Code:
nvram set static_leasenum=1

Run Commands
Commands window:
Code:
nvram set static_leases=A1:A1:A1:A1:A1:A1=Computer=192.168.1.11=1440

Run Commands
Commands window:
Code:
nvram commit

Run Commands

Services tab -> Services subtab
Change the "Client Lease Expiration" to "720" minutes.
click "Save" button <- WORKS
click "Apply Settings" button <- WORKS
click "Reboot Router" button <- WORKS

I'm concerned that entries into the "Commands" window can freeze buttons in other windows (possible bug).

Am I doing something wrong?
What am I missing?
Is this behavior a bug?

Thank you.
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Mon Apr 19, 2021 23:37    Post subject: Reply with quote
what is the output of nvram show | grep static_lease via telnet / ssh? I have a feeling you're entering the information wrong (for one), for two, you have to use && for multiple commands, if I am not mistaken. It will only do one of the commands, not all of them. I think this was a long-standing misconception and misinterpretation as to how the commands tab works. Startup, custom, firewall scripts are not the same as just arbitrarily running commands from that page. If you're using multiple webUI tabs in separate browser tabs, please get some fresh air.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
resolv
DD-WRT Novice


Joined: 19 Apr 2021
Posts: 24

PostPosted: Tue Apr 20, 2021 1:56    Post subject: Reply with quote
kernel-panic69, thank you for your response.

Quote:
you have to use && for multiple commands


The following works:
Code:
nvram set static_leasenum=1 &&
nvram set static_leases=A1:A1:A1:A1:A1:A1=Computer=192.168.1.11=1440 &&
nvram commit


Thank you for the solution!
SurprisedItWorks
DD-WRT Guru


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

PostPosted: Mon Apr 26, 2021 19:57    Post subject: Reply with quote
cmd1 && cmd2

or

cmd1 && \
cmd2


means run cmd1 and if it is successful (linux exit code 0), and only if it is successful, run cmd2. This is basic linux/bash stuff and is discussed in countless online tutorials.

Next, don't use Run Commands at all. It is quirky and doesn't give people the expected results. To run commands by hand, use ssh/PuTTy.

Use the Commands window to enter Startup or Firewall material (shell commands), and then use Save Startup or Save Firewall. This is basic dd-wrt stuff and is discussed in countless places.

Also in countless forum posts: the best place to enter static-lease info is in Additional Dnsmasq Options in GUI>Services>Services. Format is

dhcp-host=xx:xx:xx:xx:xx:xx,192.168.1.100,MyTV,1440

but you can omit the IP or the number of lease minutes at the end. For example,

dhcp-host=xx:xx:xx:xx:xx:xx,MyTV

simply names the device with the specific MAC so that it will show by name in the status-page table of DHCP leases. Or just omit the time to have it default to the time you set in GUI>Setup>BasicSetup or, if the specific IP is in a different (from the default) subnet, the time you set in GUI>Setup>Networking in the DHCP section at the end:

dhcp-host=xx:xx:xx:xx:xx:xx,192.168.2.100,MyTV

I think you can actually specify other subsets of parameters, but I haven't tried them. Find the dnsmasq "man page" online to sort it out if you are curious.

_________________
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.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic 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