summaryrefslogtreecommitdiff
path: root/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-09-05 18:39:51 -0500
committerJohn Klug <john.klug@multitech.com>2017-09-14 17:38:41 -0500
commit380abd487551ecf881a31c78eb5ad76fce781b6d (patch)
treefd17cdf5a1d144101b0e25cb78e44ffdcebc037a /recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
parentf7e6124afe37d7ffad1efa9e563e9da9cb9f69af (diff)
downloadmeta-mlinux-380abd487551ecf881a31c78eb5ad76fce781b6d.tar.gz
meta-mlinux-380abd487551ecf881a31c78eb5ad76fce781b6d.tar.bz2
meta-mlinux-380abd487551ecf881a31c78eb5ad76fce781b6d.zip
Avoid unnecessary chat switches, and less logging
Diffstat (limited to 'recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn')
-rwxr-xr-xrecipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn22
1 files changed, 16 insertions, 6 deletions
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
index da87cd3..535ab17 100755
--- a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
@@ -31,10 +31,14 @@ function setchat {
>&2 echo "Invalid firmware SKU $fw"
return 1
else
- if ((silent == 0)) ; then
- echo "Setting chat script to ${lna3_chat_file[$fw]}"
+ canon_src=$(readlink -f "${lna3_chat_file[$fw]}")
+ canon_dest=$(readlink -f "${lna3_chat_link}")
+ if [[ ${canon_src} != ${canon_dest} ]] ; then
+ if ((silent == 0)) ; then
+ echo "Setting chat script to ${lna3_chat_file[$fw]}"
+ fi
+ ln -sf "${lna3_chat_file[$fw]}" "${lna3_chat_link}"
fi
- ln -sf "${lna3_chat_file[$fw]}" "${lna3_chat_link}"
fi
}
@@ -93,8 +97,14 @@ else
fi
if fwreply=$(/usr/sbin/mlinux-switch-cell-fw -1); then
- [[ $fwreply =~ Cellular[[:space:]]+radio[[:space:]]+firmware[[:space:]]+has[[:space:]]+been[[:space:]]+switched[[:space:]]+to[[:space:]]+([^[:space:]]*)[[:space:]]+image\. ]]
- fw=${BASH_REMATCH[1]}
- setchat $fw 0
+ if [[ $fwreply =~ Cellular[[:space:]]+radio[[:space:]]+firmware[[:space:]]+has[[:space:]]+(already[[:space:]]+)been[[:space:]]+switched[[:space:]]+to[[:space:]]+([^[:space:]]*)[[:space:]]+image\. ]] ; then
+ fw=${BASH_REMATCH[2]}
+ setchat $fw 0
+ else
+ fw=$(radio-query --active-firmware)
+ if (($? == 0)) ; then
+ setchat $fw 0
+ fi
+ fi
fi
fi \ No newline at end of file