Posted: Mon Mar 18, 2013 16:04 Post subject: Where to store Startup Script
I don't really want to enable JFFS for a simple script, is there anywhere I can upload my 1Kb script to for simple use? It won't be writing anything other than to NVRAM Variables and it only weighs 1Kb in size. Am I stuck to either JFFS or USB or can I place it in another Dir somewhere since it's so small?
Hmm, I looked around in the GUI in Advanced and Setup and a couple other but didn't find a textarea with the name custom scripts or any heading of that sorts. I search google also but nothing. Where's that at?
And it says of the 4 places these two:
/etc/config/
/tmp/etc/config/
Could I just rename my script to 'myscript.startup' and upload to /tmp/etc/config using scp? Would it stay there and not disappear when I restarted router or unplugged?
Gotta say this one has me kind of lost ha ha. Thanks.
Joined: 21 Sep 2007 Posts: 373 Location: pittsburgh pa
Posted: Sun Apr 28, 2013 14:37 Post subject:
the firmware partition in flash is READ ONLY, you wont be able to put it in /etc.
if you put it in /tmp, this is a ramdisk and will be erased on next reboot.
you have 4 options:
1. read/write storage - this can be mmc/sd mod, jffs space, or usb thumb stick
2. network drive, cifs - automount a network share, put your script in there, execute it.
3. gui startup script - under admin -> commands. anything in here will be stored as an nvram variable called rc_startup. it will eat an additional 1k or however large your script is of nvram space.
4. firmwaremodkit - you can extract your dd-wrt firmware, put your custom script somewhere on the rootfs, rebuild the firmware, and flash it back to your router. your script will be part of the actual dd-wrt image now, located on the rootfs, as read-only. be sure to set execute permissions on the script before rebuilding with firmware mod kit.
i like #4 the best. _________________ TP-Link TL-WR1043ND - DD-WRT std BS build 20675
WRT54GS v3/64mb ram/usb/sd mod - Tomato 1.28.0000 MIPS1 K26
WRT54G v5/16mb ram/usb/sd mod - DD-WRT mega BS build 14929
WAP54g v2/32mb ram/usb/sd mod - DD-WRT micro Eko Build 15943
WRTSL54GS sd mod - DD-WRT mini-usb Eko build 18946
Belkin N300 - DD-WRT std-usb-nas Eko build 16773M K2.6
the firmware partition in flash is READ ONLY, you wont be able to put it in /etc.
if you put it in /tmp, this is a ramdisk and will be erased on next reboot.
you have 4 options:
1. read/write storage - this can be mmc/sd mod, jffs space, or usb thumb stick
2. network drive, cifs - automount a network share, put your script in there, execute it.
3. gui startup script - under admin -> commands. anything in here will be stored as an nvram variable called rc_startup. it will eat an additional 1k or however large your script is of nvram space.
4. firmwaremodkit - you can extract your dd-wrt firmware, put your custom script somewhere on the rootfs, rebuild the firmware, and flash it back to your router. your script will be part of the actual dd-wrt image now, located on the rootfs, as read-only. be sure to set execute permissions on the script before rebuilding with firmware mod kit.
i like #4 the best.
Hi,I like #4 too.
And can you extract the latest firmware using the mod kit? Can you delete some language packs, I can do it only with old builds.
And I need to put an autoap script into the builds,it actually has 4 files,just under roofts? How to make it as startup script each time the router boots?