| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# SPDX-License-Identifier: CC0-1.0 |
| 4 |
# 2021 Aleksander Morgado <[email protected]> |
| 5 |
# |
| 6 |
# Sierra Wireless FCC unlock mechanism |
| 7 |
# HP 820 G1 (EM7355), 03f0:4e1d |
| 8 |
# Dell DW5570 (MC8805), 413c:81a3 |
| 9 |
# Dell DW5808 (MC7355), 413c:81a8 |
| 10 |
# Lenovo-shipped EM7455, 1199:9079 |
| 11 |
# |
| 12 |
|
| 13 |
# require program name and at least 2 arguments |
| 14 |
[ $# -lt 2 ] && exit 1 |
| 15 |
|
| 16 |
# first argument is DBus path, not needed here |
| 17 |
shift |
| 18 |
|
| 19 |
# second and next arguments are control port names |
| 20 |
for PORT in "$@"; do |
| 21 |
# match port name |
| 22 |
echo "$PORT" | grep -q cdc-wdm && { |
| 23 |
CDC_WDM_PORT=$PORT |
| 24 |
break |
| 25 |
} |
| 26 |
done |
| 27 |
|
| 28 |
# fail if no cdc-wdm port exposed |
| 29 |
[ -n "$CDC_WDM_PORT" ] || exit 2 |
| 30 |
|
| 31 |
# run qmicli operation |
| 32 |
qmicli --device-open-proxy --device="/dev/$CDC_WDM_PORT" --dms-set-fcc-authentication |
| 33 |
exit $? |