-
Notifications
You must be signed in to change notification settings - Fork 0
/
tracker.sh
executable file
·28 lines (26 loc) · 968 Bytes
/
tracker.sh
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
#!/bin/bash
exec 2> /dev/null
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped CTRL-C"
exit 0
}
file=$1;
#touch $file
## shellcheck disable=SC2034
#while ( (i=7;i<=12;i++) ); do
# sleep 3s;
# rssi=`iw dev wlan0 station dump | grep "signal:" | tail -n 1 | awk '{print $2}'`;
# echo $rssi >> $file;
#done
while true; do
# ts=$(python3 -c 'import datetime; print(datetime.datetime.now().strftime("%s.%f"))')
# echo $ts, $(ssh [email protected] iw dev wlan0 station dump | grep "signal:" | tail -n 1 | awk '{print $2}') >> $file
# echo $ts, $(ssh [email protected] -q iw dev wlan0 station dump | grep "signal:" | tail -n 1 | awk '{print $2}')
# echo 1 >> $file
echo $(ssh [email protected] iw dev wlan0 station dump | grep "signal:" | tail -n 1 | awk '{print $2}') >> $file
# echo "$(ssh [email protected] -q iw dev wlan0 station dump | grep "signal:" | tail -n 1 | awk '{print $2}')"
sleep 1s;
done