Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 11-06-2005, 07:41 PM   #1
LQ Newbie
Registered: Nov 2005
Posts: 8

Rep: Reputation: 0
Running a script to start WiFi on boot

I have a wireless card and every time i startup I have to log in to root and type in the following:

wlanconfig ath0 create wlandev wifi0 wlanmode sta
iwconfig ath0 essid ANY
ifconfig ath0 up

I made a script to do it, so it's a little easier. Is there any way I can get those commands to run at start up? One catch is that I have to be logged in as root to run those commands. Thanks for any help.
Old 11-06-2005, 08:00 PM   #2
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
well, you didnt way your distrobution, but there is usually a file called rc.local in /etc/rc.d, all you have to do is add those lines to it, and it will run on boot. you may want to give a timeout factor to the dhcp client. you will have to man your dhcp client though. this way, it doesnt sit there and sit there for a minute or so when you boot. just set it for 10 seconds or so, then if that doesnt work, you can get one manually. with dhcpcd it is the -t option, so on my system i have

dhcpcd -d -t 10 eth1

the -d option just makes it print my mac and ip address if it gets one. i dont know how it is with dhclient, but im sure there are plenty of options that will do the same thing. but if there isnt a timeout option, somewhere somehow, i would suggest getting dhcpcd. cause rc.local will run and complete before you can login, so you dont want to be siting there if you take you laptop somewhere away from the AP, or into another network where you need different options. good luck.

if there isnt an rc.local, post back, we'll figure it out. make sure to give your distro though.
Old 11-06-2005, 08:26 PM   #3
LQ Newbie
Registered: Nov 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Sorry, I run Fedora Core 4 kernel 2.6.13-1.

I stuck those lines in the rc.local file, but it didn't work right. After it ran them in rc.local, I tried to manually type them in again, and I couldn't get it to work. I had to reboot w/ the original rc.local. I could not find a timeout or a pause option for the dhclient command. I don't have dhcpcd, but I'm going to download it right now and try it.
Old 11-06-2005, 09:00 PM   #4
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
I have a wireless card and every time i startup I have to log in to root and type
You probably have "ifup(devicename)" scripts for that in /etc/sysconfig/network-scripts, which will work with config files in /etc/sysconfig/networking/profiles/(profilename) if you have those. If you configure your device right the /etc/rc.(runlevel)d/network service will bring the device up.

*BTW, you better put WiFI questions in Forums > Networking > Wireless.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Up script for wireless running with Ndiswrapper mckinlsm Linux - Wireless Networking 3 10-20-2008 11:11 PM
Howto start script at boot ? hendrixx Programming 3 11-15-2005 01:42 PM
Script to see if a process ir running, if not start it ncsuapex Programming 4 07-03-2005 01:27 PM
getting script to start at boot short101 Debian 2 01-24-2005 06:32 AM
running start up script Kendo1979 Linux - General 2 11-08-2004 12:48 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:58 PM.

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