View previous topic :: View next topic |
Author |
Message |
member101 n00b

Joined: 20 Dec 2005 Posts: 16
|
Posted: Mon Oct 02, 2006 9:30 am Post subject: [Solved] Automatically running script on startup |
|
|
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 |
|
 |
gerdesj l33t


Joined: 29 Sep 2005 Posts: 622 Location: Yeovil, Somerset, UK
|
Posted: Mon Oct 02, 2006 9:45 am Post subject: Re: Automatically running script on startup |
|
|
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 |
|
 |
zsoltika l33t


Joined: 13 Nov 2003 Posts: 634 Location: Budapest, Hungary
|
|
Back to top |
|
 |
member101 n00b

Joined: 20 Dec 2005 Posts: 16
|
Posted: Mon Oct 02, 2006 10:00 am Post subject: |
|
|
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 |
|
 |
gerdesj l33t


Joined: 29 Sep 2005 Posts: 622 Location: Yeovil, Somerset, UK
|
Posted: Mon Oct 02, 2006 5:27 pm Post subject: |
|
|
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 |
|
 |
|