diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2018-05-15 15:50:24 +0300 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2018-05-15 12:03:49 -0500 |
commit | 0ae578fd7955cae5c63cc6e80ee46aaad12a5279 (patch) | |
tree | 7e88d7635af39d190544570c23a45953c162ff01 /recipes-bsp/multitech/radio-reset/radio-reset.init | |
parent | d89ab03409d531d21a791108367ae68d0a1f22a0 (diff) | |
download | meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.gz meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.bz2 meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.zip |
Move radio-reset init scripts to a separate recipe.
Diffstat (limited to 'recipes-bsp/multitech/radio-reset/radio-reset.init')
-rw-r--r-- | recipes-bsp/multitech/radio-reset/radio-reset.init | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.init b/recipes-bsp/multitech/radio-reset/radio-reset.init new file mode 100644 index 0000000..1326fee --- /dev/null +++ b/recipes-bsp/multitech/radio-reset/radio-reset.init @@ -0,0 +1,35 @@ +#!/bin/sh + +# set default values +ENABLED="yes" +ONSTART="no" +ONSTOP="yes" + +if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then + exit 0 +fi + +# load the values from /etc/default/radio-reset +[ -r /etc/default/radio-reset ] && source /etc/default/radio-reset + +case $1 in + start) + if [[ $ENABLED == "yes" ]] && [[ $ONSTART == "yes" ]] ; then + mts-io-sysfs store radio-reset 0 + echo "Resetting cellular radio" + fi + ;; + stop) + if [[ $ENABLED == "yes" ]] && [[ $ONSTOP == "yes" ]] ; then + mts-io-sysfs store radio-reset 0 + echo "Resetting cellular radio" + fi + ;; + reload) + mts-io-sysfs store radio-reset 0 + ;; + *) + echo "Usage: $0 {start|stop|reload}" + exit 2 + ;; +esac |