-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwlan-quality
More file actions
executable file
·37 lines (30 loc) · 926 Bytes
/
wlan-quality
File metadata and controls
executable file
·37 lines (30 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
function test-quality()
{
deviceName=${1}
interfaceAddress=${2}
count=${3}
# /etc/cron.hourly/${deviceName}-fwei
averagePing=`ping -c 5 -I ${interfaceAddress} sol | fgrep rtt\ min/avg/max/mdev | cut --delimiter=/ --fields=5`
linkQuality=`iwconfig ${deviceName} | fgrep Link\ Quality= | cut --delimiter== --fields=2 | cut --delimiter=/ --fields=1`
echo ${count},${averagePing},${linkQuality}
}
if [ ${#} -lt 1 ]
then
${0} 10
else
deviceName=`basename ${0} | cut --delimiter=- --fields=1`
ifconfig ${deviceName}
iwconfig ${deviceName}
interfaceAddress=`ifconfig ${deviceName} | fgrep inet\ addr | cut --delimiter=: --fields=2 | cut --delimiter=\ --fields=1`
echo Count,Average ping,Link quality
for (( count=1 ; count <= ${1} ; count++ ))
do
test-quality ${deviceName} ${interfaceAddress} ${count}
if [ ${count} -lt ${1} ]
then
sleep 5
fi
done
fi
exit 0