Your here: Home/ Network / WiFi / DD-WRT Tutorials / Script Execution


Sometimes you want scripts to be executed automatically when something happens, this article explains how to make sure scripts get executed at a certain point.

General InformationEdit

There are four different directories DD-WRT searches for scripts, these are

  • /etc/config/ (found to be read only)
  • /jffs/etc/config/
  • /mmc/etc/config/
  • /tmp/etc/config/

Script TypesEdit

You need to add an extension to the script if placed in one of the previous folders. Every extension has its own meaning.

Extension Explanation
.startup will be executed on system startup, normally boot-time and before the firewall is configured.
.prewall will be executed whenever the WAN interface goes up and before the firewall.
.wanup will be executed whenever the WAN interface goes up and after the firewall.
.if will be executed whenever any interface goes up and after the firewall.
.ipup is run when PPP connection is reestablished after a disconnect and after the firewall.
.ipdown is run when a PPP connection has been shut down
.sesbutton is executed when the SES/AOSS/EZ-SETUP button is pressed

Remember to change permissions on any script files using chmod to permit execution. Scripts with .wanup may be run several times when the router boots. ( see )

Execute Scripts with a Different Extension or in a Different FolderEdit

If you want to execute scripts with a different extension or those that are located in an other folder you can create this script

for I in `/bin/ls /jffs/etc/config/*.myextension`;do
   sh $I &

Of course you need to change the path (/jffs/etc/config) and the extension itself to match your desire.

How It WorksEdit

The command sh /jffs/etc/config/*.myextension will execute every script ending in .myextension found in the /jffs/etc/config directory. By setting this as the rc_startup value, your *.myextension scripts will load every time the router boots.


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.