Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo
- echo
- echo "Enter the WNIC you wish to test the quality of:"
- read nic
- echo
- if [ "$nic" == 'exit' ]
- then
- break
- fi
- if [ "$nic" == 'quit' ]
- then
- break
- fi
- echo "Please be patient, script working..."
- sudo iwlist $nic scanning > wireless_network_list
- if [ -n "$nic" ]
- then
- echo
- total=0
- echo "How many times would you like to test the wireless quality?"
- read count
- current=0
- while [ $current -le $count ]
- do
- sudo iwconfig $nic > wireless_details
- quality=$(grep "Quality" wireless_details)
- let total += $(quality:32:2)
- let current += 1
- done
- let total /= $count
- echo "The average signal strength was $total and the signal level is $(quality:43}"
- string=$(grep "ESSID:" wireless_details)
- echo "$nic is connected to the network ${string:31}"
- count=$(grep -c "ESSID" wireless_network_list)
- echo "There are $count networks within range"
- echo
- else
- echo "You did not enter a NIC"
- fi
- fi
- rm wireless_network_list
- rm wireless_details
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement