Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lines 416 to 491 of /etc/rc.d/rc.network (puppylinux)
- # http://www.pearltrees.com/s243a/lines-408-650-rc-network/id16447168
- # this should tell us if to use wlan_ng etc.
- if [ "$USE_WLAN_NG" = "yes" ] ; then ####### use wlanctl-ng ########
- if runPrismScan "$INTERFACE" ; then #>/dev/null
- # go over access points (POINTNUM set in function)
- for P in $(seq 0 $POINTNUM) ; do
- grep -Fq 'resultcode=success' /tmp/prism-scan$P || continue
- getPrismCellParameters $P
- # we should have CELL_ESSID, CELL_CHANNEL,
- # CELL_AP_MAC, CELL_MODE, CELL_ENCRYPTION
- # see if access point configured
- #### need to see about the ecryption part: gives "true" or "no_value"
- case $CELL_ENCRYPTION in
- true) CELL_ENCRYPTION=WEP ;;
- *) CELL_ENCRYPTION=Open ;;
- esac
- if [ -f "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf" ] ; then
- # unset static ip variables
- unset STATIC_IP IP_ADDRESS NETMASK DNS_SERVER1 DNS_SERVER2 GATEWAY
- # source it
- . "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf"
- assignProfileData
- # try connection
- if useWlanctl && sleep 1 && testInterface ; then
- # sleep a bit, just in case (net-setup.sh has 5 seconds!)
- #sleep 1
- # try and get ip address
- if try_and_connect ; then
- # done! stop everything.
- rm /tmp/wlan-up /tmp/prism-* >/dev/null 2>&1
- success_message
- #exit
- # move to next interface (to allow more than one)
- GOT_ONE="yes"
- continue 2
- else
- failure_message
- fi
- elif [ "$CELL_ENCRYPTION" = "Open" ] ; then # add to list of open networks
- OPEN_NETWORKS="$OPEN_NETWORKS $P"
- else # failure of useWlanctl
- failure_message
- fi #if useWlanctl &&
- fi #if [ -f "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf" ] ; then
- done # for P in
- # if we got here, we are not connected yet, look at open networks
- if [ -n "$OPEN_NETWORKS" ] ; then
- WLAN_SECURE="opensystem"
- PROFILE_KEY=""
- # unset static ip variables
- unset STATIC_IP IP_ADDRESS NETMASK DNS_SERVER1 DNS_SERVER2 GATEWAY
- for P in $OPEN_NETWORKS ; do
- grep -Fq 'resultcode=success' /tmp/prism-scan$P || continue
- getPrismCellParameters $P
- # set the PROFILE_ variables
- PROFILE_ESSID="$CELL_ESSID"
- if useWlanctl && sleep 1 && testInterface ; then
- # sleep a bit, just in case (net-setup.sh has 5 seconds!)
- #sleep 1
- # try and get ip address
- if try_and_connect ; then
- # done! stop everything.
- rm /tmp/wlan-up /tmp/prism-* >/dev/null 2>&1
- success_message
- #exit
- # move to next interface (to allow more than one)
- GOT_ONE="yes"
- continue 2
- else
- failure_message
- fi
- else # failure of useWlanctl
- failure_message
- fi
- done
- fi
- rm /tmp/wlan-up /tmp/prism-* >/dev/null 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement