summaryrefslogtreecommitdiff
path: root/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-switch-apn
diff options
context:
space:
mode:
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-apn11
1 files changed, 6 insertions, 5 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 8a70036..f6b1894 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
@@ -26,7 +26,7 @@ function usage {
echo "The firmware image SKU is optional."
echo "If not specified, the image SKU is queried (recommended)."
echo "Current valid SKU's are 0 and 1"
- echo "Only LE910-NA1 is supported"
+ echo "Only LE910-NA1 is supported on product-ids containing string -LNA3-"
exit 1
}
@@ -44,12 +44,13 @@ if (($# > 0)) ; then
fi
fi
else
-
+ radioproduct=$(/usr/sbin/mts-io-sysfs show product-id) # Hopefully LNA3
((query=0))
lna3_chat_file=/etc/ppp/peers/lna3_chat
model=$(radio-query --model 2>/dev/null)
- if [[ $model != "LE910-NA1" ]] ; then
- # Nothing to do
+ if [[ $model != "LE910-NA1" ]] || ! [[ $radioproduct =~ "-LNA3-" ]] ; then
+ [[ $VERBOSE ]] && echo "Firmware switch is supported only on LE910-NA1 models with product-id containing -LNA3-."
+ # Nothing to do
exit 0
fi
fw=$(radio-query --active-firmware 2>/dev/null) || ((fw=-1))
@@ -67,7 +68,7 @@ else
# Set non-Verizon APN in chat file
# if sed -r -i "s/^(#comment by mlinux-set-apn )* OK\s+'AT\+CGDCONT=3,\"IPV4V6\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=3,\"IPV4V6\",\"${apn}\"'/" $lna3_chat_file ; then
# (OK\s+'AT\+CGDCONT=3,\"IPV4V6\",\"(^\"]*\"'$)
- if sed -r -i "s/^(#comment by mlinux-set-apn )*(OK\s+'AT\+CGDCONT=3,\"IPV4V6\",\"[^\"]*\"'$)/\2/" $lna3_chat_file ; then
+ if sed -r -i "s/^(#comment by mlinux-set-apn )*(OK\s+'AT\+CGDCONT=3,\"[^\"]*\",\"[^\"]*\"'$)/\2/" $lna3_chat_file ; then
echo "Set APN in $lna3_chat_file"
else
echo "Failed to set APN in $lna3_chat_file"