#!/bin/sh ################################################################## # BiffSocko # wscan (wireless scan) # # scans wireless area for # wireless network ESSID's # # run wconnect to connect # to an ESSID # # Support Free Software: # # This program is free software; you can redistribute it # and/or modify it, but don't forget to credit the author. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ################################################################## INTERFACE="ath0" # Shameless Self Promotion echo "$0 was written by BiffSocko 9/2006" if [ $UID -ne 0 ] then echo "you need to be root to run this program" exit 1 fi echo "Status for Network Interface $INTERFACE:" ifconfig $INTERFACE | grep UP if [ $? -eq 0 ] then echo "list scan" wlanconfig $INTERFACE list scan echo "===================================================" iwlist $INTERFACE scan exit 0 else echo "$INTERFACE interface is down .. trying to bring it up" ifconfig $INTERFACE up if [ $? -eq 0 ] then echo "getting ESSID info" sleep 3 echo "Network Interface $INTERFACE is now up" wlanconfig $INTERFACE list scan echo "===================================================" iwlist $INTERFACE scan exit 0 else echo "can't bring up Network Interface $INTERFACE" exit 1 fi fi