#!/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."