#start
rm wpa.conf
rm wep.conf
killall NetworkManager
killall knetworkmanager
killall wpa_supplicant
killall dhclient
clear
echo "Enter the interface name (eth1, wlan0, rausb0, etc)"
read IFACE
clear
echo "it takes a little bit"
airmon-ng stop wlan0
airmon-ng stop mon0
clear
echo "dont worry its not frozen it just takes a moment"
echo "about 30 seconds so be patient"
echo "and dont hit enter"
ifconfig $IFACE up
wait 20
clear
echo "Is this WEP?"
echo "Type yes or no"
read YN
clear
if [ "$YN" != "no" ]
then
echo "Enter the WEP's SSID!"
read SSIDWEP
clear
echo 'network={ \n ssid="'$SSIDWEP'" \n key_mgmt=NONE \n wep_key0="fakeauth" \n }' > wep.conf
wpa_supplicant -c wep.conf -i $IFACE -Dwext -B
echo "Enter the WEP key!"
read WEPKEY
iwconfig $IFACE key $WEPKEY
clear
echo "Now just dhclient your interface or write iptabels"
fi
if [ "$YN" != "yes" ]
then
echo "Enter the WPA/WPA2's SSID!"
read SSIDWPA
clear
echo "Enter the WPA/WPA2 key!"
read WPAKEY
clear
F=">"
echo wpa_passphrase $SSIDWPA $WPAKEY $F wpa.conf > wpas.sh
echo iwconfig $IFACE essid $SSIDWPA > iw.sh
clear
sh wpas.sh
sh iw.sh
rm wpas.sh
rm iw.sh
clear
wpa_supplicant -B -Dwext -i $IFACE -c wpa.conf
clear
echo "Now just dhclient your interface or write iptabels"
fi
#end