aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-05-27 12:34:38 +0200
committerDaniel Golle <daniel@makrotopia.org>2021-06-15 11:48:20 +0100
commit3d026d24257a0e2f3170538d8a54d520315699a1 (patch)
treee5363b61c9a9581c3fb633aa91a1fee7dd355744 /package/utils
parentfbb9b1f8ed0d8a76dd989cc6c16a4e0fda2b6e74 (diff)
downloadupstream-3d026d24257a0e2f3170538d8a54d520315699a1.tar.gz
upstream-3d026d24257a0e2f3170538d8a54d520315699a1.tar.bz2
upstream-3d026d24257a0e2f3170538d8a54d520315699a1.zip
ugps: start also in case device is absent
Don't bail out from init script in case the GPS device is missing. Some modems take time to come up, and some people may use things like 'kplex' to feed ugpsd. Hence it is better to always start ugpsd unconditionally and let procd's respawn take care of retrying. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/utils')
-rw-r--r--package/utils/ugps/files/ugps.init13
1 files changed, 9 insertions, 4 deletions
diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init
index 3cd1ca1b8d..77c3603066 100644
--- a/package/utils/ugps/files/ugps.init
+++ b/package/utils/ugps/files/ugps.init
@@ -16,11 +16,16 @@ start_service() {
local disabled="$(uci get gps.@gps[-1].disabled || echo 0)"
[ "$disabled" == "0" ] || return
+ [ "$tty" ] || return
- [ -c "$tty" ] || {
- tty="/dev/$tty"
- [ -c "$tty" ] || return
- }
+ case "$tty" in
+ "/"*)
+ true
+ ;;
+ *)
+ tty="/dev/$tty"
+ ;;
+ esac
procd_open_instance
procd_set_param command "$PROG"