Where to store Startup Script

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
jfreak53
DD-WRT Novice


Joined: 17 Mar 2013
Posts: 10

PostPosted: Mon Mar 18, 2013 16:04    Post subject: Where to store Startup Script Reply with quote
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?
Sponsor
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Mon Mar 18, 2013 18:42    Post subject: Reply with quote
gui custom script
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
jfreak53
DD-WRT Novice


Joined: 17 Mar 2013
Posts: 10

PostPosted: Mon Mar 18, 2013 19:11    Post subject: Reply with quote
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?

I found this page:
http://www.dd-wrt.com/wiki/index.php/Script_Execution

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.
web1
DD-WRT Novice


Joined: 14 May 2011
Posts: 39

PostPosted: Sat Apr 27, 2013 22:39    Post subject: Reply with quote
Enable jffs and put it there.


mkdir /jffs/etc
mkdir /jffs/etc/config

cd /jffs/etc/config/
cat - > myscript.startup << EOF
#!/bin/sh
# this should startup at boot

(your code here)

EOF

chmod 755 myscript.startup

It should start up but on some versions it might not.
smokinabowl
DD-WRT User


Joined: 21 Sep 2007
Posts: 373
Location: pittsburgh pa

PostPosted: Sun Apr 28, 2013 14:37    Post subject: Reply with quote
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
eeff11
DD-WRT User


Joined: 23 Jan 2013
Posts: 116

PostPosted: Fri Jul 19, 2013 11:08    Post subject: Reply with quote
smokinabowl wrote:
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?

Thanks.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking 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 cannot attach files in this forum
You cannot download files in this forum