diff options
Diffstat (limited to 'recipes-core/multitech/cell-radio-fwswitch/cell-radio-fwswitch.init')
-rw-r--r-- | recipes-core/multitech/cell-radio-fwswitch/cell-radio-fwswitch.init | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/recipes-core/multitech/cell-radio-fwswitch/cell-radio-fwswitch.init b/recipes-core/multitech/cell-radio-fwswitch/cell-radio-fwswitch.init deleted file mode 100644 index 82b5cb5..0000000 --- a/recipes-core/multitech/cell-radio-fwswitch/cell-radio-fwswitch.init +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -# no firmware switch by default -ENABLED="no" -# radio come up timeout -TIMEOUT=15 -# default radio firmware image id -FWIMAGE="0" - -[ -r /etc/default/cell-radio-fwswitch ] && source /etc/default/cell-radio-fwswitch -[ "$ENABLED" == "yes" ] || exit 0 - -function start() { - FWACTIVE=$(radio-query --active-firmware) - if [[ $? != 0 || x"$FWACTIVE" == x"" ]]; then - # radio does not support firmware switching. - exit 0 - fi - - FWSWITCH=$(curl -s 127.0.0.1/api/ppp/modem/fwSwitch | jsparser -p /result/) - if [[ x"$FWSWITCH" == x"" ]]; then - echo "Failed to obtain the radio firmware image id to use." - exit 1 - fi - - if [[ "$FWSWITCH" == "att" ]]; then - FWIMAGE="0" - elif [[ "$FWSWITCH" == "vz" ]]; then - FWIMAGE="1" - else - # autodetect - ICCID=$(radio-query --iccid) - if [ $? -ne 0 ]; then - exit 0 - fi - if [[ "$ICCID" =~ ^89148.* ]]; then - # - # Switch to FW image #1 for Verizon SIMs - # - FWIMAGE="1" - fi - fi - - cell-radio-fwswitch $FWIMAGE $TIMEOUT -} - -case $1 in - start) - start - ;; - - *) - echo "Usage: $0 {start}" - exit 2 - ;; -esac - |