Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lines 1992 to 2021 of /usr/sbin/wag-profiles.sh
- # http://www.pearltrees.com/s243a/runprismscan-puppylinux/id16476573
- # Dougal: put this into a function, so we can use it at boot time
- # (note that it echoes Xs for the progress bar)
- runPrismScan()
- {
- INTERFACE="$1"
- # enable interface
- wlanctl-ng "$INTERFACE" lnxreq_ifstate ifstate=enable >/tmp/wlan-up 2>&1
- # scan (first X echoed only afterwards!
- wlanctl-ng "$INTERFACE" dot11req_scan bsstype=any \
- bssid=ff:ff:ff:ff:ff:ff ssid="" scantype=both \
- channellist="00:01:02:03:04:05:06:07:08:09:0a:0b:00:00" \
- minchanneltime=200 maxchanneltime=250 >/tmp/prism-scan-all 2>/dev/null
- echo "X"
- # get number of access points (make sure we get integer)
- POINTNUM=$(grep -F 'numbss=' /tmp/prism-scan-all 2>/dev/null | cut -d= -f2 | grep [0-9])
- rm /tmp/prism-scan-all >/dev/null 2>&1
- ## Dougal: not sure about this -- need a way to make sure we get something
- #if grep -F 'resultcode=success' /tmp/prism-scan-all ; then
- if [ "$POINTNUM" ] ; then
- # get scan results for all access points
- for P in $(seq 0 $POINTNUM)
- do
- wlanctl-ng "$INTERFACE" dot11req_scan_results bssindex=$P >/tmp/prism-scan$P 2>/dev/null
- done
- echo "X"
- else # let us know it failed
- return 1
- fi
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement