Simple script for wpa_supplicant
I recently installed BT3 to my HDD, so I was thinking on a way to run wpa_supplicant automatically! I'm assuming that wpa_supplicant.conf is properly configure and ready to execute when called.
First create a bash file using an editor, save without extension
# chmod 755 filename -read,write,exe privileges
ifconfig ath0 up
echo "starting wpa_supplicant"
wpa_supplicant -w -D wext -i ath0 -c /etc/wpa_supplicant.conf
# ./filename -execute the file
Next, open a terminal and get an ip
# dhcpcd ath0
Done! I'm also looking for a way of opening a second terminal in the script in order to execute dhcpcd as well. After that find a way of running this automatically at startup!
Ideas are welcome. Thx
Wireless in Slackware based systems.
Hi, I'm new to BackTrack but I've been using Slackware for a while now... I know this thread's a bit old, but thought I'd stick my oar in anyway, and hopefully teach somebody something. In Slack 12 (might be slightly different in 12.1), edit /etc/rc.d/rc.inet1.conf and scroll down to the section commented as 'Example config information for wlan0'. All you need to do is uncomment (remove the # at the beginning) each line you will need. For a pretty standard WPA-PSK DHCP setup, you should just need to uncomment IFNAME and change the value to the name of your wifi device (ath0, eth1, wlan0 etc), USE_DHCP (set it to "yes" - lower case). Next uncomment WLAN_ESSID and put in your own... Next up WLAN_MODE - set it to 'Managed'. WLAN_KEY needs to be set to your PSK, and WLAN_WPA should be "wpa_supplicant".
This should get it all going from startup, as /etc/rc.d/rc.inet1 script runs during startup.
It may all seem a bit daunting to those new to linux, but you're gonna have to get dirty sooner or later :D These scripts are really useful to know back to front for anything network related.
P.S. If you really want to use your own script to connect, then just edit /etc/rc.d/rc.local and add a new line which is the location of your script. That will cause it to run this script as soon as the machine finishes it's init scripts.