Advertisement
s243a

Lines 420 to 459 - /etc/rc.d/rc.network - puppylinux

Oct 16th, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.89 KB | None | 0 0
  1. # lines 420 to 459 of /etc/rc.d/rc.network - puppylinux
  2. # http://www.pearltrees.com/s243a/lines-420-network-puppylinux/id16476469
  3.         for P in $(seq 0 $POINTNUM) ; do
  4.           grep -Fq 'resultcode=success' /tmp/prism-scan$P || continue
  5.           getPrismCellParameters $P
  6.           # we should have CELL_ESSID, CELL_CHANNEL,
  7.           # CELL_AP_MAC, CELL_MODE, CELL_ENCRYPTION
  8.           # see if access point configured
  9.           #### need to see about the ecryption part: gives "true" or "no_value"
  10.           case $CELL_ENCRYPTION in
  11.             true) CELL_ENCRYPTION=WEP ;;
  12.             *) CELL_ENCRYPTION=Open ;;
  13.           esac
  14.           if [ -f "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf" ] ; then
  15.             # unset static ip variables
  16.             unset STATIC_IP IP_ADDRESS NETMASK DNS_SERVER1 DNS_SERVER2 GATEWAY
  17.             # source it
  18.             . "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf"
  19.             assignProfileData
  20.             # try connection
  21.             if useWlanctl && sleep 1 && testInterface ; then
  22.               # sleep a bit, just in case (net-setup.sh has 5 seconds!)
  23.               #sleep 1
  24.               # try and get ip address
  25.               if try_and_connect ; then
  26.                 # done! stop everything.
  27.                 rm /tmp/wlan-up /tmp/prism-* >/dev/null 2>&1
  28.                 success_message
  29.                 #exit
  30.                 # move to next interface (to allow more than one)
  31.                 GOT_ONE="yes"
  32.                 continue 2
  33.               else
  34.                 failure_message
  35.               fi
  36.             elif [ "$CELL_ENCRYPTION" = "Open" ] ; then # add to list of open networks
  37.               OPEN_NETWORKS="$OPEN_NETWORKS $P"
  38.             else # failure of useWlanctl
  39.               failure_message
  40.             fi #if useWlanctl &&
  41.           fi #if [ -f "${PROFILES_DIR}/${CELL_AP_MAC}.${CELL_ENCRYPTION}.conf" ] ; then
  42.         done # for P in
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement