diff options
| -rwxr-xr-x | src/dirty_hack.sh | 9 | ||||
| -rw-r--r-- | src/log_shit.py | 8 | ||||
| -rwxr-xr-x | src/skid.sh | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/dirty_hack.sh b/src/dirty_hack.sh index 67691a3..6366d80 100755 --- a/src/dirty_hack.sh +++ b/src/dirty_hack.sh @@ -1,8 +1,11 @@ #!/usr/bin/env zsh -mmcli -m any --location-get | # get location from modem manager -grep "long\|lat\|alt" | # select only relevant lines +(mmcli -m any --location-get; + mmcli -m any | + grep ignal | + cut -d'%' -f1) | # get location from modem manager +grep "long\|lat\|alt\|ignal" | # select only relevant lines cut -d':' -f2 | # remove colons, cut -d' ' -f2 | # and leading spaces tr '\n' ',' | # csv-esque -cut -d',' -f1-3 # remove unwanted newline
\ No newline at end of file +cut -d',' -f1-4 # remove unwanted newline
\ No newline at end of file diff --git a/src/log_shit.py b/src/log_shit.py index 7e5da43..295dc45 100644 --- a/src/log_shit.py +++ b/src/log_shit.py @@ -27,10 +27,12 @@ print("[i] we out here, yo", flush=True) while (start + time_to_do_it) > now(): # print("we out here, yo", flush=True) - lat, lon, alt = [float(x) for x in subprocess.getoutput("src/dirty_hack.sh").split(",")] + lat, lon, alt, sig = [float(x) for x in subprocess.getoutput("src/dirty_hack.sh").split(",")] - print("[i] %f: %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt)) - f.write("%f: %f, %f, %f\n" % (time.time_ns() / (10**9), lat, lon, alt)) + sig /= 100 + + print("[i] %f: %f, %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt, sig)) + f.write("%f: %f, %f, %f, %f\n" % (time.time_ns() / (10**9), lat, lon, alt, sig)) f.flush() diff --git a/src/skid.sh b/src/skid.sh index 07cc305..9cc41c2 100755 --- a/src/skid.sh +++ b/src/skid.sh @@ -17,4 +17,4 @@ sleep 1 echo '[*] doing it.' -python3 src/log_shit.py `date +%s`.log 1 600
\ No newline at end of file +python3 src/log_shit.py log/`date +%s`.log 1 600
\ No newline at end of file |
