Parcourir la source

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 <[email protected]>
Daniel Golle il y a 4 ans
Parent
commit
3d026d2425
1 fichiers modifiés avec 9 ajouts et 4 suppressions
  1. 9 4
      package/utils/ugps/files/ugps.init

+ 9 - 4
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"