diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2020-10-16 05:29:34 -0400 |
---|---|---|
committer | Loic Poulain <loic.poulain@linaro.org> | 2020-10-19 08:22:33 -0400 |
commit | 702ea7ee5888826949234d880391ddd69bc9c6fe (patch) | |
tree | 73973b70bd4bdd824c1005776159feff01bae50a | |
parent | e6686087f368a44f39bb2219d570baad231f8dd8 (diff) |
Check root execution
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-rwxr-xr-x | mhi-qmi-connect-legacy | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mhi-qmi-connect-legacy b/mhi-qmi-connect-legacy index a20b699..4c20ebf 100755 --- a/mhi-qmi-connect-legacy +++ b/mhi-qmi-connect-legacy @@ -109,7 +109,7 @@ net_mtu="not-found" qmi_wds_get_settings() { - res=$(qmicli -d ${qmidev} --wds-get-current-settings ${wds_options} 2>&1) + res=$(qmicli -d ${qmidev} --wds-get-current-settings ${wds_options} 2> /dev/null) if (( $? != 0 )); then echo "**ERROR retrieving settings" echo "------" @@ -186,7 +186,7 @@ release_rmnet() interrupt_cb() { - echo "** Interrupted" + echo " => Interrupted" qmi_wds_release_cid release_rmnet exit 0 @@ -198,6 +198,11 @@ if (( $# < 1 )); then fi apn=$1 +if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit +fi + qmi_device_find if (( $# > 1 )); then pin=$2 |