Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #From line #309 of /usr/sbin/wag-profiles.sh
- # http://www.pearltrees.com/s243a/wag-profiles-sbin-puppylinux/id16403051
- showProfilesWindow()
- {
- INTERFACE="$1"
- # Dougal: find driver and set WPA driver from it
- INTMODULE=$(readlink /sys/class/net/$INTERFACE/device/driver)
- INTMODULE=${INTMODULE##*/}
- case "$INTMODULE" in
- #hostap*) CARD_WPA_DRV="hostap" ;; removed Oct 2011
- #rt61|rt73) CARD_WPA_DRV="ralink" ;; removed Oct 2011
- #r8180|r8187) CARD_WPA_DRV="ipw" ;; removed Oct 2011
- # Dougal: all lines below are "wext" (split and alphabetized for readability)
- r8180|rtl819*|vt665*) CARD_WPA_DRV="wext" ;;#v511
- ath_pci) modprobe wlan_tkip ; CARD_WPA_DRV="wext" ;;
- ath5k*|ath9k*|b43|b43legacy|bcm43xx) CARD_WPA_DRV="wext" ;;
- ipw2100|ipw2200|ipw3945|iwl3945|iwl4965|iwl5100|iwlagn) CARD_WPA_DRV="wext" ;;
- ndiswrapper|p54pci|p54usb|rndis_wlan) CARD_WPA_DRV="wext" ;;
- rt61pci|rt73usb|rt2400pci|rt2500*|rt28[67]0*|rtl8180|rtl8187) CARD_WPA_DRV="wext" ;;
- zd1211|zd1211b|zd1211rw) CARD_WPA_DRV="wext" ;;
- ar9170usb|at76c50x-usb|libertas_cs|libertas_sdio|libertas_tf_usb|mwl8k|usb8xxx) CARD_WPA_DRV="wext" ;; #v430
- usb|brcm*|hostap*) CARD_WPA_DRV="wext" ;; #Sep 2011, Oct 2011
- ar55*) CARD_WPA_DRV="wext" ;; #tempestuous April 2011
- *) # doesn't support WPA encryption
- # add an option to add modules to file
- if [ -f "$Extra_WPA_Modules_File" ] &&\
- CARD_WPA_DRV=$(grep -m1 "^$INTMODULE:" $Extra_WPA_Modules_File) ; then
- CARD_WPA_DRV=${CARD_WPA_DRV#*:}
- else
- CARD_WPA_DRV=""
- giveNoWPADialog
- fi
- ;;
- esac
- # Dougal: add usage of wlan-ng, for prism2_usb module
- case "$INTMODULE" in prism2_*) USE_WLAN_NG="yes" ;; esac
- refreshProfilesWindowInfo
- setupNewProfile
- EXIT=""
- while true
- do
- buildProfilesWindow
- I=$IFS; IFS=""
- ## Add escaping of funny chars before we eval the statement!
- for STATEMENT in $(gtkdialog3 --program NETWIZ_Profiles_Window | sed 's%\$%\\$%g ; s%`%\\`%g ; s%"%\\"%g ; s%=\\"%="%g ; s%\\"$%"%g' ); do
- eval $STATEMENT
- done
- IFS=$I
- clean_up_gtkdialog NETWIZ_Profiles_Window
- unset NETWIZ_Profiles_Window
- case "$EXIT" in
- "abort" | "19" ) # Back or close window
- break
- ;; # Do Nothing, It will exit the while loop
- "11" ) # Scan
- showScanWindow
- ;;
- "12" ) # New profile
- setupNewProfile
- ;;
- "20" ) # Save
- assembleProfileData
- saveProfiles
- refreshProfilesWindowInfo
- loadProfileData "${CURRENT_PROFILE}"
- ;;
- "21" ) # Delete
- deleteProfile
- NEW_PROFILE_DATA=""
- #saveProfiles
- refreshProfilesWindowInfo
- setupNewProfile
- ;;
- "22" ) # Use This Profile
- if useProfile ; then
- return 0
- else # Dougal: add new message to say it failed
- return 2
- fi
- ;;
- "40" ) # Advanced fields
- if [ "$ADVANCED" ] ; then
- unset -v ADVANCED
- else
- ADVANCED=1
- fi
- ;;
- ## Dougal: comment out all the button shading below, so they
- ##+ only get shaded when loading a profile!
- "50" ) # No encryption
- PROFILE_ENCRYPTION="Open"
- #ENABLE_WEP_BUTTON='false'
- #ENABLE_WPA_BUTTON='false'
- #ENABLE_WPA2_BUTTON='false'
- #ENABLE_OPEN_BUTTON='true'
- ;;
- "51" ) # WEP
- PROFILE_ENCRYPTION="WEP"
- #ENABLE_WEP_BUTTON='true'
- #ENABLE_WPA_BUTTON='false'
- #ENABLE_WPA2_BUTTON='false'
- #ENABLE_OPEN_BUTTON='false'
- ;;
- "52" ) # WPA
- PROFILE_ENCRYPTION="WPA"
- PROFILE_WPA_TYPE=""
- #ENABLE_WEP_BUTTON='false'
- #ENABLE_WPA_BUTTON='true'
- #ENABLE_WPA2_BUTTON='false'
- #ENABLE_OPEN_BUTTON='false'
- ;;
- "53" ) # WPA2
- PROFILE_ENCRYPTION="WPA2"
- PROFILE_WPA_TYPE="2"
- #ENABLE_WEP_BUTTON='false'
- #ENABLE_WPA_BUTTON='false'
- #ENABLE_WPA2_BUTTON='true'
- #ENABLE_OPEN_BUTTON='false'
- ;;
- load) # If it wasn't any other button, it must be a profile button
- PROFILE_TITLES="$( echo "$PROFILE_TITLES" | grep -v \"#NEW#\" )"
- CURRENT_PROFILE="$PROFILE_COMBO"
- loadProfileData "$CURRENT_PROFILE"
- ;;
- esac
- done
- return 1
- } # end showProfilesWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement