aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-05-14 18:50:35 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-07-03 16:08:52 +0200
commitbe46ed88d627522973a8c0c3e081bad29d13265b (patch)
tree3f46ead1fbf96ca4a181b11bb7dddaa6c735daea /utils
parent611c5a77371c2c6b5b47901f5e29dfe66527d32c (diff)
downloadexternal_libqmi-be46ed88d627522973a8c0c3e081bad29d13265b.zip
external_libqmi-be46ed88d627522973a8c0c3e081bad29d13265b.tar.gz
external_libqmi-be46ed88d627522973a8c0c3e081bad29d13265b.tar.bz2
qmi-network: stopping while already stopped won't issue an error
Diffstat (limited to 'utils')
-rwxr-xr-xutils/qmi-network32
1 files changed, 15 insertions, 17 deletions
diff --git a/utils/qmi-network b/utils/qmi-network
index 6f1684e..97ea14d 100755
--- a/utils/qmi-network
+++ b/utils/qmi-network
@@ -115,27 +115,25 @@ start_network ()
stop_network ()
{
if [ "x$CID" = "x" ]; then
- echo "error: cannot stop network, no CID" 1>&2
- exit 3
- fi
-
- if [ "x$PDH" = "x" ]; then
- echo "error: cannot stop network, no PDH" 1>&2
- exit 3
- fi
-
- STOP_NETWORK_CMD="qmicli -d $DEVICE --wds-stop-network=$PDH --client-cid=$CID"
- echo "Stopping network with '$STOP_NETWORK_CMD'..."
+ echo "Network already stopped"
+ elif [ "x$PDH" = "x" ]; then
+ echo "Network already stopped; need to cleanup CID $CID"
+ # Cleanup the client
+ qmicli -d "$DEVICE" --wds-noop --client-cid="$CID"
+ else
+ STOP_NETWORK_CMD="qmicli -d $DEVICE --wds-stop-network=$PDH --client-cid=$CID"
+ echo "Stopping network with '$STOP_NETWORK_CMD'..."
- if [[ "x$QMIDEBUG" != "x" ]]; then
- STOP_NETWORK_OUT="\
+ if [[ "x$QMIDEBUG" != "x" ]]; then
+ STOP_NETWORK_OUT="\
[/dev/cdc-wdm0] Network stopped
"
- else
- STOP_NETWORK_OUT=`$STOP_NETWORK_CMD`
- fi
+ else
+ STOP_NETWORK_OUT=`$STOP_NETWORK_CMD`
+ fi
- echo "Network stopped successfully"
+ echo "Network stopped successfully"
+ fi
clear_state
}