You are not logged in.

#1 2012-12-28 18:14:32

savithari
Member
From: Marietta, GA
Registered: 2012-01-28
Posts: 45

how to select ssid from the command line

Friends:

I currently use the wifi-menu command and select my ssid each time and it works well.

However I prefer to put it an a script that I can run so it selects "myssid" from the command line and does not require my intervention.

What is the command to do that from command line ?

-N

Offline

#2 2012-12-28 18:30:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: how to select ssid from the command line

You want the script to stop and ask which ssid to use?  I am not a bash genius, but can I suggest a different way?

Use an variable within the script, say myssid.  Assuming the script is called thescriptname and the access point is called theSsidName; then, invoke the script as thus:

myssid=theSsidName thescriptname

Last edited by ewaller (2012-12-28 18:30:55)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2012-12-28 18:44:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,491
Website

Re: how to select ssid from the command line

I may be misunderstanding (as I'm reading this differently from ewaller) but it sounds like you are looking for the following:

iwconfig wlan0 essid myessid

Note that wlan0 must be your interface (perhaps eth0 or something else).  Also myessid is the essid you wish to connect to.  This only works for "open" or unsecured networks.  For secure networks you'd use wpa_supplicant.

You could also use a tool like netcfg, in which case you'd use a command something like "netcfg MYPROFILE" where MYPROFILE is a profile you've created.  Finally, if you keep an eye on the community contribution section, I'll be posting my vastly revamped wifi connection tool in a day or two (or get a preview in my "wifi2" repo on github).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB