Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Automatically running script on startup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
member101
n00b
n00b


Joined: 20 Dec 2005
Posts: 16

PostPosted: Mon Oct 02, 2006 9:30 am    Post subject: [Solved] Automatically running script on startup Reply with quote

Hi,

I'm not sure what section to put this in...

I want to run the following commands on startup to bring up my wireless network:

Code:

wlanconfig ath0 create wlandev wifi0 wlanmode sta
ifconfig ath0 up
iwlist ath0 scan
iwconfig ath0 essid "myessid"
wpa_supplicant -B -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf
dhclient ath0


How do I go about doing this? I know you can rc-update add net.ath0, but I'm using wpa_supplicant in this case.

Thanks


Last edited by member101 on Mon Oct 02, 2006 10:01 am; edited 1 time in total
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 622
Location: Yeovil, Somerset, UK

PostPosted: Mon Oct 02, 2006 9:45 am    Post subject: Re: Automatically running script on startup Reply with quote

You could put that lot in /etc/conf.d/local.start but baselayout supports wpa_supplicant fine, see /etc/conf.d/net.example. Not sure what version of baselayout it was added but I've been using it for at least six months.

Cheers
Jon
Back to top
View user's profile Send private message
zsoltika
l33t
l33t


Joined: 13 Nov 2003
Posts: 634
Location: Budapest, Hungary

PostPosted: Mon Oct 02, 2006 9:48 am    Post subject: Reply with quote

Try this thread: https://forums.gentoo.org/viewtopic.php?t=122435
Duplicate thread.
_________________
Do not believe that Guru thing under my nickname.
Back to top
View user's profile Send private message
member101
n00b
n00b


Joined: 20 Dec 2005
Posts: 16

PostPosted: Mon Oct 02, 2006 10:00 am    Post subject: Reply with quote

Thanks for the quick replies.

I'd flicked through that long thread but didn't really take it in.

For simplicity I put it in /etc/conf.d/local.start though I'm sure baselayout is a more elegant solution.
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 622
Location: Yeovil, Somerset, UK

PostPosted: Mon Oct 02, 2006 5:27 pm    Post subject: Reply with quote

If it helps, I have the following in my net, note that I use wpa_supplicant and NDISwrapper:

Code:
modules=(
        "iproute2"
        "dhcpcd"
        "wpa_supplicant"
)

modules_wlan0=( "!plug" )

plug_timeout="5"

wpa_supplicant_wlan0="-Dwext"

config_eth0=(
        "dhcp"
)

config_eth1=(
        "dhcp"
)

config_wlan0=(
        "dhcp"
)


I have a symlink for net.wlan0 in my /etc/init.d, I've also got a few settings in /etc/wpa_supplicant.conf:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
        ssid="blueloop"
        psk="............"
        key_mgmt=WPA-PSK
        pairwise=TKIP
        scan_ssid=1
        priority=5
}


It works absolutely flawlessly to my Draytek upstairs and that's with a very naff RT2400

Cheers
Jon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum