[PATCH mepo] Make Geoclue timeout configurable
Export this patch
Stop executing where-am-i in the background since there isn't
seem to be a reason to do so.
---
scripts/mepo_ui_menu_user_pin_updater.sh | 15 ++++++ ---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/scripts/mepo_ui_menu_user_pin_updater.sh b/scripts/mepo_ui_menu_user_pin_updater.sh
index 09ce16b16c1d..24fed64e3fe2 100755
--- a/scripts/mepo_ui_menu_user_pin_updater.sh
@@ -13,6 +13,7 @@ DOC='
[ -z "$MEPO_USERPIN_ENABLED" ] && MEPO_USERPIN_ENABLED="1"
[ -z "$MEPO_ENDPOINT_MLS" ] && MEPO_ENDPOINT_MLS="https://location.services.mozilla.com/v1/geolocate"
[ -z "$MEPO_APIKEY_MLS" ] && MEPO_APIKEY_MLS="9a418f3c-364a-418a-85e8-1bde733f0c88"
+ [ -z "$MEPO_TIMEOUT_GEOCLUE" ] && MEPO_TIMEOUT_GEOCLUE="10"
coordsviamls() {
MLSRESULT="$(
@@ -29,16 +30,12 @@ coordsviageoclue() {
/usr/libexec/geoclue-2.0/demos/agent > /dev/null &
AGENTPID=$!
- LATLON="$(
- ( /usr/libexec/geoclue-2.0/demos/where-am-i -t 10 & ) |
- grep -E "Latitude|Longitude:" -m2 |
- cut -d: -f2 |
- tr -d "° " |
- tr "\n" " "
- )"
+ /usr/libexec/geoclue-2.0/demos/where-am-i -t $MEPO_TIMEOUT_GEOCLUE |
+ grep -E "Latitude|Longitude:" -m2 |
+ cut -d: -f2 |
+ tr -d "° " |
+ tr "\n" " "
kill -9 $AGENTPID
- pkill -9 -f where-am-i
- echo "$LATLON"
}
supportsgeoclue() {
--
2.37.3
Applied! Thanks for catching this, this is cleaner without the unnecessary
pkill command and having the geoclue timeout being configurable I can
indeed see as being helpful to end-users.