Bläddra i källkod

uqmi: wait forever registration if timeout set to 0

Give possibility to wait forever the registration by setting timeout
option to 0.

No timeout can be useful if the interface starts whereas no network is
available, because at the end of timeout the interface will be stopped
and never restarted.

Signed-off-by: Thomas Richard <[email protected]>
Thomas Richard 5 år sedan
förälder
incheckning
2b3a0cabea
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh

+ 2 - 2
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh

@@ -82,7 +82,7 @@ proto_qmi_setup() {
 	local uninitialized_timeout=0
 	local uninitialized_timeout=0
 	while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
 	while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
 		[ -e "$device" ] || return 1
 		[ -e "$device" ] || return 1
-		if [ "$uninitialized_timeout" -lt "$timeout" ]; then
+		if [ "$uninitialized_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then
 			let uninitialized_timeout++
 			let uninitialized_timeout++
 			sleep 1;
 			sleep 1;
 		else
 		else
@@ -195,7 +195,7 @@ proto_qmi_setup() {
 	local registration_timeout=0
 	local registration_timeout=0
 	while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
 	while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
 		[ -e "$device" ] || return 1
 		[ -e "$device" ] || return 1
-		if [ "$registration_timeout" -lt "$timeout" ]; then
+		if [ "$registration_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then
 			let registration_timeout++
 			let registration_timeout++
 			sleep 1;
 			sleep 1;
 		else
 		else