LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 08-12-2010, 03:22 PM   #1
TheStarLion
Member
 
Registered: Nov 2009
Location: UK
Distribution: Gentoo
Posts: 472

Rep: Reputation: 41
Wireless by command line


Thanks to the Arch Wiki, I've managed to figure out how to scan for wireless networks, connect to one, and get an IP address on my Arch box.

Since I connect to the router at home most of the time, I wrote a short script I can run from a panel launcher to connect to it.

This leaves me with a few questions though.

First, how does one disconnect from a terminal, and put it in a state ready to scan for a network again?

Second, is there any way to have my script get called during boot up, rather than after logging in? I can move it to a more suitable location than my home folder if necessary.

And third, if I've connected via command line like this, what ways are to obtain statistics such as signal strength, noise and so on? Can Conky be configured to show this information?

Thanks in advance.
 
Old 08-13-2010, 10:09 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Have you discovered the man pages for iwconfig & friends?
Read up on them. To your wuestions
1. Have you tried ifconfig wlan0 down?
2. Call your script from /etc/rc.d/~/rc.local.
3. Iwconfig's friend iwlist gives those details, and there are no doubt other ways.
 
Old 08-13-2010, 10:42 AM   #3
TheStarLion
Member
 
Registered: Nov 2009
Location: UK
Distribution: Gentoo
Posts: 472

Original Poster
Rep: Reputation: 41
With a little look into those man pages, I've solved the first and last, at least.
I'm not entirely certain how /etc/rc.local works - do I just add a line that runs the script, something like this:
Code:
sh /home/user/wireless_connect.sh
 
Old 08-14-2010, 03:39 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I don't think you need the 'sh'. Here's the rc.local from this old box
bash-3.1$ cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local startup commands in here. Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

/usr/bin/inadyn --input_file /etc/inadyn.conf --background
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to a wireless network via command line greplinux Linux - Newbie 3 08-09-2010 11:24 PM
Connecting to a wireless network from command-line Daravon Linux - Newbie 21 12-06-2009 01:35 AM
Connecting to wireless network using command line. imagine_me2 Linux - Newbie 2 12-03-2009 04:28 AM
wireless linux via command line Four Linux - Newbie 1 12-27-2006 10:27 PM
Can't activate wireless card from command line jdrietz Slackware 21 02-01-2006 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 10:43 AM.

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