How exactly do I get this script to start automatically? Format JFFS and then create a folder called scripts and put your code in it as a text file or something?
The way that I did this was to select "enable jffs" and "format jffs after next boot" in the "Administration" -> "System" tab, and then click "Apply". At this point you reboot your router, and when it comes back up again, you should have a /jffs file system and a directory /jffs/scripts (and also a directory called /jffs/configs, both are created for you).
Then go to the /jffs/scripts directory, create a file named "init-start" with the contents mentioned in the previous post. I use "vi" for this, since I've been a UNIX/Linux user for a long time *smile*. Then when you're satisfied that the file is there with the right contents, use "chmod" to add execute permissions:
chmod a+x init-start
and you can use:
ls -l
in that directory to verify that the file has been created and has the right permissions.
At this point, run the script to be sure that it works:
./init-start
and then use "cat" to output the contents of the files that you're changing out to the screen to be sure that the script has done what it is supposed to. Now, every time you boot after this, your init-start script will be run.
Also, I'd suggest adding this line to your script:
touch /tmp/init-start.ran
Then you can look at /tmp any time and see that the script ran since you last booted. That's been useful to me with these startup scripts.
I think that's about it.
If the gc_* parameters listed in the previous posting aren't large enough to prevent the messages, then play with the numbers until the messages no longer appear *smile*.