script hook execute after each apply config

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


Joined: 10 Apr 2022
Posts: 6

PostPosted: Fri Jan 27, 2023 14:53    Post subject: script hook execute after each apply config Reply with quote
I would like to run a script any time the <apply settings> button is clicked in the DDWRT web gui. I use startup scripts to configure my router but this configuration gets wiped out each time I click on <apply settings> which instead fetches the configuration from the NVRAM variables and updates the router configuration every time I click on <apply settings> thereby wiping out my startup script configuration. This means I must remember to reboot my router every time I make a settings change in the gui.

What I would like is each time I apply a new setting in the gui to have a hook automatically run my startup script after the settings have been saved.

Tks.
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Fri Jan 27, 2023 15:27    Post subject: Reply with quote
not bad to tell us what router and which build you are running ...as there may be build errors..

on apply start up script and firewall script are executed and some services restarted...the most save practice is to save and reboot...as sometimes apply can interfere with some other settings...
you can use custom script ..witch is not executed on apply...but you have to call it...manually or
via or usb script commands...if you call it from start up script it will be executed on apply ...i guess...
to call custom script:

sh /tmp/.rc_custom &

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Jan 27, 2023 15:31    Post subject: Reply with quote
Usually the firewall script will run, so instead of calling the script from Startup, call from Firewall.
Note it can be called more than once.

WireGuard and OpenVPN have their own hooks as has USB

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


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Fri Jan 27, 2023 20:03    Post subject: Reply with quote
Alozaros wrote:
on apply start up script and firewall script are executed and some services restarted...

Only the firewall script is called on Apply; this was mentioned several times in the forum in the recent past...

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
papdee
DD-WRT Novice


Joined: 10 Apr 2022
Posts: 6

PostPosted: Sat Jan 28, 2023 0:17    Post subject: Reply with quote
Netgear R6260

I am running build 51506

USB may not be working as well
papdee
DD-WRT Novice


Joined: 10 Apr 2022
Posts: 6

PostPosted: Sat Jan 28, 2023 0:24    Post subject: Reply with quote
dale_gribble39 wrote:
Alozaros wrote:
on apply start up script and firewall script are executed and some services restarted...

Only the firewall script is called on Apply; this was mentioned several times in the forum in the recent past...


do firewall scripts get executed both on startup and apply ?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sat Jan 28, 2023 7:25    Post subject: Reply with quote
Yes, but I am not sure it will be executed on all applies but certainly on almost all.
_________________
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
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