-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.sh
More file actions
49 lines (42 loc) · 1.22 KB
/
display.sh
File metadata and controls
49 lines (42 loc) · 1.22 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/bash
#set -x
clear
#row_1
start_date=$(date +%s)
#end_date=$(echo $date - 5 | bc)
#echo $date $end_date
while true; do
clear
date=$(date +%s)
end_date=$(echo $date - 5 | bc)
range=''
tput cup 0 40; /usr/bin/mysql -u pi -h 127.0.0.1 -N probeprint <<< "select count(*) from ssid where time > \"$start_date\";"
#tput cup 1 38; vcgencmd measure_temp
while read line;
do
arr=($line)
echo ${arr[0]} | xxd -r -p
rssi2=${arr[1]}
if [[ $rssi2 -gt -66 ]]
then
if [[ $rssi2 -ne 0 ]];
then
range=near\ by
fi
else
if [[ $rssi2 -gt -82 ]]
then
range=medium\ range
else
range=far\ away
fi
fi
if [ -n "$range" ]; then
echo \ $range
fi
/usr/bin/mysql -u pi -h 127.0.0.1 -N probeprint <<< "select location,category,is_name,is_airport from ssid_intel where ssid_hex=\"${arr[0]}\" and ssid_hex!=\"<MISSING>\";" | sed 's/OTHER_UNKNOWN//g'
#done <<< $(/usr/bin/mysql -u pi -h 127.0.0.1 -N probeprint <<< "select distinct ssid_hex,rssi from ssid where time>\"$end_date\" and ssid_hex!=\"<MISSING>\" ;")
done <<< $(/usr/bin/mysql -h 127.0.0.1 -u pi -N probeprint <<< "select distinct ssid_hex,rssi from ssid where time>\"$end_date\" and ssid_hex!=\"<MISSING>\" ;")
sleep 5
done
wait