rendered paste body#!/bin/bashWLANIF=rausb0ENCTYPE=$1SSID=$2KEY=$3DHCP=$4wep_connect(){ifconfig $WLANIF downifconfig $WLANIF upiwconfig $WLANIF essid $SSIDiwconfig $WLANIF mode Managediwpriv $WLANIF set AuthMode=WEPAUTOiwpriv $WLANIF set EncrypType=WEPiwpriv $WLANIF set Key1=$KEYip_assign}wpa_connect(){ifconfig $WLANIF downifconfig $WLANIF upiwconfig $WLANIF essid $SSIDiwconfig $WLANIF mode Managediwpriv $WLANIF set AuthMode=WPAPSKiwpriv $WLANIF set EncrypType=TKIPiwpriv $WLANIF set WPAPSK=$KEYip_assign}wpa2_connect(){ifconfig $WLANIF downifconfig $WLANIF upiwconfig $WLANIF essid $SSIDiwconfig $WLANIF mode Managediwpriv $WLANIF set AuthMode=WPA2PSKiwpriv $WLANIF set EncrypType=AESiwpriv $WLANIF set WPAPSK=$KEYip_assign}ip_assign(){if [ "$DHCP" = "s" ]then set_staticelse dhclient $WLANIFfifinalize}set_static(){echo "Enter IP:"read ipecho "Enter netmask:"read netmaskifconfig $WLANIF $ip netmask $netmask up}finalize(){iwconfig $WLANIFifconfig $WLANIFexit 0}error_text(){echo "Syntax:"echo "rt73wifi [wep|wpa|wpa2] SSID KEY [s]"echo "SSID = Network SSID"echo "KEY = Network Key"echo "If \"s\" is present, you will be prompted for a static IP"}if [ "$1" = "wep" ]then wep_connectfiif [ "$1" = "wpa" ]then wpa_connectfiif [ "$1" = "wpa2" ]then wpa2_connectfierror_textexit 0