Skip to content

Instantly share code, notes, and snippets.

@limed
Created March 12, 2012 23:19
Show Gist options
  • Save limed/2025339 to your computer and use it in GitHub Desktop.
Save limed/2025339 to your computer and use it in GitHub Desktop.
shell script to connect to OSU_Secure wireless
#!/bin/bash
INTERFACE=$1
WHOAMI=`whoami`
if [ $WHOAMI != 'root' ]; then
echo "Must run as root"
exit 1
fi
if [ $# != 1 ]; then
echo "Usage: $0 [interface]"
exit 1
else
# make sure wpa_supplicant isn't running
pkill wpa_supplicant
wpa_supplicant -D wext -i $INTERFACE -c /etc/wpa_supplicant/wpa_supplicant.conf -B
dhclient $INTERFACE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment