Created
June 21, 2019 17:14
-
-
Save mdukat/2acdb774a30025fde386cc84265668f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple wifi data logger | |
# d3s | |
pingSite='onet.pl' | |
wifiName=$(nmcli connection show | head -2 | tail -1 | sed 's/ .*//g') | |
echo $wifiName | |
wifiIp=$(curl -s https://ipinfo.io/ip) | |
echo $wifiIp | |
wifiData=$(curl -s https://ipvigilante.com/${wifiIp}) | |
wifiLong=$(echo $wifiData | jq '.data.longitude') | |
echo $wifiLong | |
wifiLati=$(echo $wifiData | jq '.data.latitude') | |
echo $wifiLati | |
wifiPing=$(ping -c 1 ${pingSite} | head -2 | tail -1 | sed 's/.*time=//; s/ .*//') | |
echo $wifiPing | |
# CSV: | |
# 1 2 3 4 5 | |
# Wifi SSID IP Longitude Latitude Ping (ms) | |
echo "\"${wifiName}\";${wifiIp};${wifiLong};${wifiLati};${wifiPing}" >> wardrive.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment