diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dirty_hack.sh (renamed from src/dirty_hack) | 0 | ||||
| -rw-r--r-- | src/log_shit.py | 12 | ||||
| -rwxr-xr-x | src/setup.sh | 13 | ||||
| -rwxr-xr-x | src/skid.sh | 10 | ||||
| -rwxr-xr-x | src/wait_for_fix.sh | 14 |
5 files changed, 42 insertions, 7 deletions
diff --git a/src/dirty_hack b/src/dirty_hack.sh index 67691a3..67691a3 100755 --- a/src/dirty_hack +++ b/src/dirty_hack.sh diff --git a/src/log_shit.py b/src/log_shit.py index a60711f..7e5da43 100644 --- a/src/log_shit.py +++ b/src/log_shit.py @@ -16,20 +16,20 @@ except: print("fake file.") sys.exit(-1) -print("file: %s\n\ -how often: %f\n\ -how long: %f" % (log_file, how_often, time_to_do_it)) +print("[i] file: %s\n\ +[i] how often: %f\n\ +[i] how long: %f" % (log_file, how_often, time_to_do_it)) start = time.time() now = time.time -print("we out here, yo", flush=True) +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").split(",")] + lat, lon, alt = [float(x) for x in subprocess.getoutput("src/dirty_hack.sh").split(",")] - print("%f: %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt)) + 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)) f.flush() diff --git a/src/setup.sh b/src/setup.sh new file mode 100755 index 0000000..c329f76 --- /dev/null +++ b/src/setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env zsh + +echo '[*] enabling gps-raw & agps-msb' +printf '[i] mmcli: ' +mmcli -m any --location-enable-{gps-raw,agps-msb} + +echo '[*] fixing refresh rate' +printf '[i] mmcli: ' +mmcli -m any --location-set-gps-refresh-rate 1 + +echo '[*] enabling signal' +printf '[i] mmcli: ' +mmcli -m any --location-set-enable-signal
\ No newline at end of file diff --git a/src/skid.sh b/src/skid.sh index 5671560..07cc305 100755 --- a/src/skid.sh +++ b/src/skid.sh @@ -4,9 +4,17 @@ clear read figlet gps_haxx +echo '=============================================' sleep 1 -echo doing it. +echo '[*] setting up...' + +src/setup.sh +src/wait_for_fix.sh + +sleep 1 + +echo '[*] doing it.' python3 src/log_shit.py `date +%s`.log 1 600
\ No newline at end of file diff --git a/src/wait_for_fix.sh b/src/wait_for_fix.sh new file mode 100755 index 0000000..ab83968 --- /dev/null +++ b/src/wait_for_fix.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env zsh + +function got_fix { + mmcli -m any --location-get | + grep -q GPS && + echo 'true' +} + +while [ "`got_fix`" != 'true' ]; do + echo "[i] waiting for fix..." + sleep 1 +done + +echo "[*] got it."
\ No newline at end of file |
