Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lines 214 to 254 of /etc/rc.d/rc.network
- # http://www.pearltrees.com/s243a/run-iw-scan-etwork-puppylinux/id16440743
- # Dougal: stick the wireless scan into a function, since we're doing some tricks
- #+ to try and ensure it works...
- run_iw_scan(){
- # add sleeping a bit for pcmcia...
- #grep -q "^pcmcia:" /sys/class/net/$INTERFACE/device/modalias && sleep 5
- #case $INTMODULE in *_cs) sleep 5 ;; esac
- checkIsPCMCIA
- [ -n "$IsPCMCIA" ] && sleep 5
- # no try runing twice and redirecting to files, then use bigger one...
- # clean up any old files
- rm /tmp/iwscan*.tmp 2>/dev/null
- iwlist "$INTERFACE" scan >/tmp/iwscan1.tmp 2>&1
- if [ -n "$IsPCMCIA" ] ; then
- sleep 1
- else
- usleep 100000
- fi
- iwlist "$INTERFACE" scan >/tmp/iwscan2.tmp 2>&1
- ScanListFile=$(du -b /tmp/iwscan*.tmp |sort -n | tail -n1 |cut -f2)
- # now try scanning
- #SCAN_LIST=$(iwlist "$INTERFACE" scan | grep 'Cell\|ESSID\|Mode\|Frequency\|Encryption\|Channel')
- #SCAN_LIST=$(grep 'Cell\|ESSID\|Mode\|Frequency\|Encryption\|Channel' $ScanListFile)
- #rm /tmp/iwscan*.tmp
- ## no, use the file all the time, so just get the cell list
- CELL_LIST=$(grep -Eo "Cell [0-9]+" $ScanListFile | cut -f2 -d " ")
- # if it failed, try sleeping and trying again
- #if [ -z "$SCAN_LIST" ] ; then
- if [ -z "$CELL_LIST" ] ; then
- # with pcmcia try ejecting and inserting (this is done in wag-profiles.sh)
- if [ -n "$IsPCMCIA" ] ; then
- pccardctl eject
- pccardctl insert
- sleep 1
- fi
- sleep 1
- #SCAN_LIST=$(iwlist "$INTERFACE" scan | grep 'Cell\|ESSID\|Mode\|Frequency\|Encryption\|Channel')
- iwlist "$INTERFACE" scan >/tmp/iwscan3.tmp 2>&1
- ScanListFile="/tmp/iwscan3.tmp"
- CELL_LIST=$(grep -Eo "Cell [0-9]+" $ScanListFile | cut -f2 -d " ")
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement