Startup Scripts

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
ofbizbrazil
Posts: 65
Joined: Mon Dec 05, 2011 7:56 pm

Startup Scripts

Post 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

airguy
Posts: 8
Joined: Thu Nov 17, 2011 6:43 am

Re: Startup Scripts

Post 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
Netgear WNDR3700 Gargoyle 1.5

samtruman
Posts: 2
Joined: Thu Apr 14, 2011 4:16 am

Re: Startup Scripts

Post 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?

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Startup Scripts

Post by pbix »

What happens when you run the scrip from the command line?
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Post Reply