summaryrefslogtreecommitdiff
path: root/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn')
-rwxr-xr-xrecipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn12
1 files changed, 12 insertions, 0 deletions
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn
index 8c59c78..3d02e16 100755
--- a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-set-apn
@@ -26,6 +26,7 @@ leu1_chat_file=/etc/ppp/peers/leu1_chat
lna3_chat_file=/etc/ppp/peers/lna3_chat_non_vz
lna3_chat_link=/etc/ppp/peers/lna3_chat
lna3_readme=/etc/ppp/peers/README.lna3
+lap3_chat_link=/etc/ppp/peers/lap3_chat
function usage {
echo "Usage: $(basename $0) [--] APN"
@@ -68,6 +69,7 @@ if ((clear != 1)) ; then
else
echo "Failed to set APN in $gsm_chat_file"
fi
+ echo "Not allowed to set APN for $lsp3_chat_file"
echo "Not allowed to set APN for $lvw2_chat_file"
# We cannot set the APN for a Verizon modem
# sed -r -i "s/^(#comment by mlinux-set-apn )*OK\s+'AT\+CGDCONT=3,\"IPV4V6\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=3,\"IPV4V6\",\"${apn}\"'/" $lvw2_chat_file
@@ -81,6 +83,11 @@ if ((clear != 1)) ; then
else
echo "Failed to set APN in $lna3_chat_file"
fi
+ if sed -r -i "s/^(#comment by mlinux-set-apn )*OK\s+'AT\+CGDCONT=([0-9]*),\"([^\"]*)\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=\2,\"\3\",\"${apn}\"'/" $lap3_chat_file ; then
+ echo "Set APN to \"${apn}\" in $lap3_chat_file"
+ else
+ echo "Failed to set APN in $lap3_chat_file"
+ fi
else
if sed -r -i "s/^(OK\s+'AT\+CGDCONT=[0-9]*,\"[^\"]*\",\"[^\"]*\"'$)/#comment by mlinux-set-apn \1/" $gsm_chat_file ; then
echo "Commented out APN in $gsm_chat_file"
@@ -101,6 +108,11 @@ else
else
echo "Failed to comment out APN in $lna3_chat_file"
fi
+ if sed -r -i "s/^(OK\s+'AT\+CGDCONT=[0-9]*,\"[^\"]*\",\"[^\"]*\"'$)/#comment by mlinux-set-apn \1/" $lap3_chat_file ; then
+ echo "Commented out APN in $lap3_chat_file"
+ else
+ echo "Failed to comment out APN in $lap3_chat_file"
+ fi
fi
exit 0