Wireless Helper Script

From UVA Linux Users Group

Jump to: navigation, search

Contents

Quick Usage for the Impatient

Here are the simplest possible instructions,

You did not pass a certificate, using aia8v-cert.p12
Enter your UVa ID:aia8v
Enter your UVa Password:
MAC verified OK
Writing configuration to /home/alex/uvaWireless/wpa_supplicant.conf

Success! Certificates stored in /home/alex/uvaWireless
If you wish to use other wireless manager use the .pem file for both ca and cl certs
Would you like to generate scripts to automate joining cavalier?[y,n]:y

The scripts are called cavUp.sh and cavDown.sh. They are on your desktop.

Done, hit enter to exit.


Thats it. Now you have two choices: 1) Use Network Manager OR 2) Use Scripts


Use Network Manager

See Cavalier Wireless with Network Manager for how to connect with the latest version of Network Manager.


Use Scripts

The scripts on the desktop called cavUp.sh and cavDown.sh should allow you to connect to cavalier and then restart NetworkManager when you disconnect. Just double click on the scripts and hit run in terminal, and you should connect to cavalier. If you dont use NetworkManager then you can alter the scripts.


Intro

This script is an attempt to automate the configuration of wpa_supplicant needed to join cavalier network. It is written for Ubuntu/Debian, but can be used on other systems with small changes.


Getting Uva_wpa.sh

Download from here, Uva_wpa.sh. Save it to disk, and make it executable by firing up a terminal, cd to where you saved the file and chmod it.

$cd Destop
$chmod u+x Uva_wpa.sh


Acquiring a certificate

At the time of this writing WPA certificates could be generated at https://www.pki.virginia.edu/cgi-bin/pkcs12proxy. If that doesn't work check here UVA's Certificate page and go to the OS X link. Acquire your certificate, download, and save it.


Invocation

Uva_wpa.sh takes a single argument, your certificate.

$./Uva_wpa.sh $MY_CERTIFICATE 

Where $My_CERTIFICATE is the certificate you saved in the previous section. Uva_wpa.sh will prompt you for your UVA username and password. It then writes the configuration for cavalier network to wpa_supplicant.conf (this may be changed by editing WPA_CONF variable within the script).

You will be asked if you want to generate cavalier up and down scripts. The up script kills NetworkManager and fires up wpa_supplicant appropriately, while the down script kills wpa_supplicant and restarts NetworkManager.

NOTE:If you don't run Ubuntu or Debian you should edit the cavalier up and down scripts appropriately.


Example Session

alex@tosh:~/Desktop$ ./Uva_wpa.sh  aia8v-cert.p12 
Enter your UVa ID:aia8v
Enter your UVa Password:
MAC verified OK
Writing configuration to /home/alex/uvaWireless/wpa_supplicant.conf

Success! Certificates stored in /home/alex/uvaWireless
If you wish to use other wireless manager use the .pem file for both ca and cl certs
Would you like to generate scripts to automate joining cavalier?[y,n]:y

The scripts are called cavUp.sh and cavDown.sh. They are on your desktop.

Done, hit enter to exit.

alex@tosh:~/Desktop$ 


Variables To Customize

At the top of the script there are a couple of variables you may change if you wish. They are self-explanatory and here are the defaults.

INSTALL_DIR=~/.uva_wpa_supplicant
WPA_CONF="$INSTALL_DIR/wpa_supplicant.conf"
SCRIPTS_DIR=~/Desktop

If you change anything, make sure that all variables are writable by the user running the script.

Personal tools