LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-14-2004, 03:50 PM   #1
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Rep: Reputation: 30
simple Gentoo, help loading wireless at boot


Hello All,

Writing from my newly configured WG311 802.11g wireless device. Yay.

But I have one question, with Gentoo what is the easiest way to initialize a simple scripts that starts my wireless drivers and shutsdown any normal eth connections, the adds route etc. Works like a dream accept now every time I boot I have to log on as root and type ./mywirelessscript

I had a look on the Gentoo main doc. pages but could not find anything that explained this simple process of initializing a script at startup. There was plenty on init scripts...

Can anybody point me in the right direction?

Thanks in advance
 
Old 05-14-2004, 07:00 PM   #2
SirGertrude
Member
 
Registered: May 2004
Location: Missouri
Distribution: Gentoo
Posts: 59

Rep: Reputation: 15
I made a script that executes my iptables configurating like this:

1. create a new file in /etc/init.d (my file is named "nat") This will be your init script.

2. edit my init script below so that the path points to your wireless script (my script path is "/scripts/nat")

3. paste the modified init script in your init script on your machine.

4. # rc-update add nat default (replace nat with your init script name)

5. reboot

My init script:

Code:
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-firewall/shorewall/files/shorewall,v 1.4 2004/03/04 19:20:40 vapier Exp $

opts="start stop restart"

depend() {
	before local
}

start() {
	ebegin "Starting NAT"
	/scripts/nat
	eend $? 
}

stop() {
	ebegin "Stopping NAT"
	/scripts/natstop
	eend $?
}

restart() {
	ebegin "Restarting NAT"
	/scripts/nat
	eend $?
}
In my init script this will run "/scripts/nat" when the system boots and "/scripts/natstop" when shutting down. You could prob use the same script for start, stop, and restart. See if this works for you.
 
Old 05-15-2004, 05:07 AM   #3
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Thankyou very much. Works perfectly.

Used the same script (/root/wifi) for start, stop and restart. I will write another small script for stop soon, to reactivate eth0 and kill ath0.

I am starting to REALLY love gentoo!!

PS does anyone know if it is not a good idea to have such scripts and drivers (as my wifi drivers currently reside in /root) in the /root folder?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems installing Gentoo / grub not loading wiredj Linux - Newbie 7 04-11-2004 05:17 PM
Gentoo--Loading b44 module at startup? deadjoebob Linux - Newbie 1 02-24-2004 09:07 AM
Dual boot w/ Gentoo/xp pro vs. gentoo-invalid partition table bobbear Linux - Software 3 02-10-2004 04:28 PM
Gentoo not loading... could it be grub? breakerfall Linux - General 1 07-28-2003 09:46 PM
Gentoo: ekpd not loading during boot busbarn Linux - Distributions 3 07-12-2003 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration