summaryrefslogtreecommitdiff
path: root/recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-08-12 12:13:11 -0500
committerJohn Klug <john.klug@multitech.com>2019-11-11 11:33:18 -0600
commit98b746138fc807062a766532908307b66043fbdb (patch)
tree0c0507f2079cc4096483b885a58c5ef6e0d6508d /recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready
parent20d6468a28678a376edbef7b2d67391dff2aaae2 (diff)
downloadmeta-mlinux-98b746138fc807062a766532908307b66043fbdb.tar.gz
meta-mlinux-98b746138fc807062a766532908307b66043fbdb.tar.bz2
meta-mlinux-98b746138fc807062a766532908307b66043fbdb.zip
Update mlinux-set-apn for new chat_wrapper script
Diffstat (limited to 'recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready')
-rw-r--r--recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready34
1 files changed, 34 insertions, 0 deletions
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready b/recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready
new file mode 100644
index 0000000..42c5cdc
--- /dev/null
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# The timeout can be set in the environment or the
+# first parameter.
+
+COUNTER=0
+
+if [ $# -gt 1 ]; then
+ echo "usage: $0 [timeout]"
+ exit 1
+fi
+
+[ $# -eq 1 ] && TIMEOUT=$1
+
+# Set the default TIMEOUT
+: ${TIMEOUT:=60}
+
+# Wait for the radio to be ready before continuing
+while [ $COUNTER -lt $TIMEOUT ]; do
+ TYPE=$(radio-query --type)
+ MODEL=$(radio-query --model)
+ if [ $? == 0 ]; then
+ echo "Cellular radio is ready."
+ exit 0
+ fi
+ let COUNTER=COUNTER+1
+
+ echo "Waiting for radio to come up in order to identify type ..."
+
+ sleep 1
+done
+
+echo "Cellular radio is not ready."
+exit 1