diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2020-02-19 15:40:44 +0200 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-05-21 10:40:11 +0300 |
commit | 19ca401463153a7694a320f543852412d74cbd8f (patch) | |
tree | e3720d485786f1f2fc78c909fc2ad2f97829ab8d /recipes-core/mlinux-scripts/mlinux-scripts-1.2/mlinux-cell-radio-ready | |
parent | ed016261befcdc421ae1ac5d28d21066b56f42f2 (diff) | |
parent | 92cbb8fb30c624d3be98d6408d6ff7f03264a2c9 (diff) | |
download | meta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.tar.gz meta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.tar.bz2 meta-mlinux-atmel-19ca401463153a7694a320f543852412d74cbd8f.zip |
mpower-dev-thud: merge meta-mlinux:master (92cbb8fb Feb 11 2020) to meta-mlinux:multiarch5-thud (ed01626 Feb 3 2020)
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-ready | 34 |
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 |