aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-03-04 12:46:23 +0100
committerAleksander Morgado <aleksander@aleksander.es>2016-03-04 12:52:02 +0100
commit88502bef52a3a045ea004b971247fa65c02e1145 (patch)
treea2c74f1ad0ff11321ea903cae4686ec0def5395d /utils
parentf7c7d433bb6056ce0d29f20d9d9ddda819a3abea (diff)
downloadexternal_libqmi-88502bef52a3a045ea004b971247fa65c02e1145.zip
external_libqmi-88502bef52a3a045ea004b971247fa65c02e1145.tar.gz
external_libqmi-88502bef52a3a045ea004b971247fa65c02e1145.tar.bz2
qmi-network: support APN user/password
Diffstat (limited to 'utils')
-rwxr-xr-xutils/qmi-network.in33
1 files changed, 29 insertions, 4 deletions
diff --git a/utils/qmi-network.in b/utils/qmi-network.in
index 52dc54c..50ef417 100755
--- a/utils/qmi-network.in
+++ b/utils/qmi-network.in
@@ -49,15 +49,20 @@ help ()
echo " /etc/qmi-network.conf"
echo
echo " 3) The APN to use should be configured in the profile, in the"
- echo " following way (e.g. assuming APN is called 'internet':"
+ echo " following way (e.g. assuming APN is called 'internet'):"
echo " APN=internet"
echo
- echo " 4) If you want to instruct the qmi-network script to use the"
+ echo " 4) Optional APN user/password strings may be given in the following"
+ echo " way:"
+ echo " APN_USER=user"
+ echo " APN_PASS=password"
+ echo
+ echo " 5) If you want to instruct the qmi-network script to use the"
echo " qmi-proxy setup, you can do so by configuring the following line"
echo " in the profile:"
echo " PROXY=yes"
echo
- echo " 5) Once the qmi-network script reports a successful connection"
+ echo " 6) Once the qmi-network script reports a successful connection"
echo " you still need to run a DHCP client on the associated WWAN network"
echo " interface."
echo
@@ -145,6 +150,18 @@ load_profile ()
echo " APN: unset"
fi
+ if [ -n "$APN_USER" ]; then
+ echo " APN user: $APN_USER"
+ else
+ echo " APN user: unset"
+ fi
+
+ if [ -n "$APN_PASS" ]; then
+ echo " APN password: $APN_PASS"
+ else
+ echo " APN password: unset"
+ fi
+
if [ "$PROXY" = "yes" ]; then
echo " qmi-proxy: $PROXY"
PROXY_OPT='--device-open-proxy'
@@ -317,7 +334,15 @@ start_network ()
setup_data_format
- START_NETWORK_CMD="qmicli -d $DEVICE --wds-start-network=$APN $USE_PREVIOUS_CID --client-no-release-cid $PROXY_OPT"
+ START_NETWORK_ARGS="apn='$APN'"
+ if [ -n "$APN_USER" ]; then
+ START_NETWORK_ARGS="${START_NETWORK_ARGS},username='$APN_USER'"
+ if [ -n "$APN_PASS" ]; then
+ START_NETWORK_ARGS="${START_NETWORK_ARGS},password='$APN_PASS'"
+ fi
+ fi
+
+ START_NETWORK_CMD="qmicli -d $DEVICE --wds-start-network=\"$START_NETWORK_ARGS\" $USE_PREVIOUS_CID --client-no-release-cid $PROXY_OPT"
echo "Starting network with '$START_NETWORK_CMD'..."
if [ -n "$QMIDEBUG" ]; then