metalx1000

Termux GPS Location Logger

May 5th, 2020
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/bin/bash
  2. #get's GPS location and TimeStamp and uploads it to a server
  3.  
  4. #change this to your server's url for logging
  5. logger="https://filmsbykris.com/scripts/2020/echo.php"
  6.  
  7. #loop forever
  8. while [ 1 ];
  9. do
  10.   #get GPS and add TIMESTAMP to JSON
  11.   gps="$(termux-location|sed "s/\"latitude\"/\"timestamp\": $(date +%s),\n  \"latitude\"/g")"
  12.  
  13.  #upload JSON to server
  14.  wget "$logger?gps=$gps" -qO-
  15. done
Add Comment
Please, Sign In to add comment