Merge request !1312 from 'fcc-unlock-grep-qi'
fcc-unlock: Case-insensitive grep for for 105b (MBIM) and 14c3 (AT) https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1312
This commit is contained in:
@@ -20,13 +20,10 @@ shift
|
||||
# second and next arguments are control port names
|
||||
for PORT in "$@"; do
|
||||
# match port type in Linux 5.14 and newer
|
||||
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && {
|
||||
MBIM_PORT=$PORT
|
||||
break
|
||||
}
|
||||
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null ||
|
||||
# match port name in Linux 5.13
|
||||
echo "$PORT" | grep -q MBIM && {
|
||||
MBIM_PORT=$PORT
|
||||
echo "$PORT" | grep -qi MBIM && {
|
||||
MBIM_PORT="$PORT"
|
||||
break
|
||||
}
|
||||
done
|
||||
|
||||
@@ -20,13 +20,10 @@ shift
|
||||
# second and next arguments are control port names
|
||||
for PORT in "$@"; do
|
||||
# match port type in Linux 5.14 and newer
|
||||
grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null && {
|
||||
AT_PORT=$PORT
|
||||
break
|
||||
}
|
||||
grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null ||
|
||||
# match port name in Linux 5.13
|
||||
echo "$PORT" | grep -q AT && {
|
||||
AT_PORT=$PORT
|
||||
echo "$PORT" | grep -qi AT && {
|
||||
AT_PORT="$PORT"
|
||||
break
|
||||
}
|
||||
done
|
||||
@@ -34,7 +31,7 @@ done
|
||||
# fail if no AT port exposed
|
||||
[ -n "$AT_PORT" ] || exit 2
|
||||
|
||||
DEVICE=/dev/${AT_PORT}
|
||||
DEVICE="/dev/$AT_PORT"
|
||||
|
||||
at_command() {
|
||||
exec 99<>"$DEVICE"
|
||||
|
||||
Reference in New Issue
Block a user