You are not logged in.

#1 2007-05-20 05:58:15

Shagbag
Member
Registered: 2006-10-25
Posts: 259

Running a Bash script as root automatically at boot [RESOLVED]

I have a small script I run to initialise my laptop's miniPCI wireless card.
The script uses iwconfig and iwpriv so it has to be run as root.
To date I have been running this script manually by su-ing into root, executing the script (./gigabyte.sh) and logging out of root.
I would like to automate this script so that it runs as part of the init process but I don't know how to do this.
Could someone tell me how to do this, please?

Last edited by Shagbag (2007-05-21 15:19:29)

Offline

#2 2007-05-20 06:10:28

thepizzaking
Member
From: Melbourne, Victoria, Australia
Registered: 2006-03-13
Posts: 46

Re: Running a Bash script as root automatically at boot [RESOLVED]

add the script to the '/etc/rc.local' file.

Offline

#3 2007-05-20 12:52:04

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Running a Bash script as root automatically at boot [RESOLVED]

And chmod +x /etc/rc.local


1000

Offline

#4 2007-05-21 15:18:22

Shagbag
Member
Registered: 2006-10-25
Posts: 259

Re: Running a Bash script as root automatically at boot [RESOLVED]

Thanks.  I added it to '/etc/rc.local' and it worked.  I didn't need to chmod +x /etc/rc.local though - maybe it's already set up like that?  (I don't know).

Anyway, it's fixed.  Thanks for your help.

Offline

Board footer

Powered by FluxBB