Page 1 of 1

Startup Scripts

Posted: Mon Dec 05, 2011 10:19 pm
by ofbizbrazil
Hi dudes,

I´d like to know how I can start a script schell automatically after a boot on my router?

I saw that in DD-WRT there´s a section where I can type it, but on Gargoyle I didn´t find it.

Let me know!!

Thanks a lot..
:D

Re: Startup Scripts

Posted: Tue Dec 06, 2011 2:54 am
by airguy
I am no expert, especially in Linux, but I just did this to enable WOL from the internet on my WNDR3700.

First you have to SSH into the router (I use putty).

cd to /etc/init.d

use Vi (text editor) to edit a file called "done". Add your commands into this file. I understand that commands in this file are executed at the end of the boot up. It worked great for me.

Here is a link for the Vi commands that was helpful:

http://www.cs.colostate.edu/helpdocs/vi.html

Re: Startup Scripts

Posted: Thu Nov 15, 2012 9:46 am
by samtruman
Hi, i nee to add a startup script to boot. to being more exact i need to execute a ping every 3 seconds to take up hspda connection.
My scrip is this

Code: Select all

while :
 do
   ping -c 5 8.8.8.8 >/dev/null     # ping 5 packets
   sleep 2                                # wait 2 seconds
 done

I add it to done script but when i reboot router sys led keep blinking and internet conenction isn't available from connected client.
So i decide to write down an entirely new script that i put in init.d:

Code: Select all

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

START=96
start() {
        while :
        do
        ping -c 5 8.8.8.8 >/dev/null # ping 5 packets
        sleep 3 # wait 3 seconds
        done

}
Then i enable it with

Code: Select all

/etc/init.d/ping enable
But when i reboot the router sys led blink and no connection.
Where is the mess?

Re: Startup Scripts

Posted: Thu Nov 15, 2012 1:35 pm
by pbix
What happens when you run the scrip from the command line?