Is there a way to apply settings with console commands?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
portsup
DD-WRT User


Joined: 20 Oct 2018
Posts: 210

PostPosted: Sat Oct 09, 2021 11:12    Post subject: Is there a way to apply settings with console commands? Reply with quote
I am not talking about 'nvram commit' as that just saves things, I am talking about the apply button with a command.
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sat Oct 09, 2021 12:17    Post subject: Reply with quote
The apply button restarts all the services/interfaces AFAIK, its all JavaScript, so you're talking about some kind of script that you would design to restart everything by calling this script without rebooting, I presume some shell script would do the job.

Restarting services and what not its pretty much simple'ish, its Linux after all in the dd-wrt flavour.

Short of that you can reboot.

You can search the source code for to_apply and look at what comes up.

For some idea look at https://github.com/mirror/dd-wrt/blob/cc5d4a3a93858e32f91c5e6efed96facf2c7ccd0/src/router/kromo/dd-wrt/common_backup/common.js#L992 and down to the next function.

No guarantees though, if you burn your house down, babies are killed and kittens drowned, refer to your own responsibility.

For a real explanation here from the man himself https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=170624#170624

hope that somewhat helps.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Oct 09, 2021 14:49    Post subject: Reply with quote
There is no 'easy' answer to this for what command(s) to use via cli. The first would be nvram commit; but
what you'd have to use after that really depends on what exactly you've changed and what router it is on.

_________________
"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
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sat Oct 09, 2021 16:20    Post subject: Reply with quote
on x86 it is the poweroff command ... go figure but I posted that here: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=330212

I am not sure if it applies to other architectures as well...
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sat Oct 09, 2021 20:50    Post subject: Reply with quote
When unsure top should know, which running services are going atm, so if for instance, you change a setting for wifi, you should have already sent that interface down, before fiddling so sending the if back up would do the trick and nothing else should be needed.

Its Linux, nothing that mysterious that ppl cant figure out. I mean If I did, other can.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


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

PostPosted: Sat Oct 09, 2021 21:48    Post subject: Reply with quote
It is Linux, but it is also DD-WRT. Restarting wireless on Broadcom, for example is different than on Atheros, Marvell, etc. There is also a specific service that is for just wireless on all platforms, as well as one for firewall, and one for networking in general, if I am not mistaken. I just think it's easier to 'nvram commit && reboot'; I don't have all my notes handy on specifics, unfortunately.
_________________
"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
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sun Oct 10, 2021 16:44    Post subject: Reply with quote
I have to agree with KP... the reboots seem more reliable and ensure that what you are doing will work next time. Otherwise I would suggest doing all of the individual commands yourself
portsup
DD-WRT User


Joined: 20 Oct 2018
Posts: 210

PostPosted: Sat Oct 16, 2021 5:36    Post subject: Reply with quote
It's a bit strange you can't easily reproduce the gui apply button in console
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sat Oct 16, 2021 7:28    Post subject: Reply with quote
portsup wrote:
It's a bit strange you can't easily reproduce the gui apply button in console

Depends what you mean by easy (strange not so much). A reboot is pretty easy, does it get any easier? Apply exists in UI, so two easy simple ways already exist.

I dont know if anyone will implement convenient command to restart all related services and send interfaced down/up (the easy one you wanted). Its open source though, usually when something is annoying enough it prompts for community driven contributions.

You also have the option of scripting way, to restart all services and send interface up down after nvram commit that's also easy, but involves some effort. Cool

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
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