fcc-unlock: Reduce the port assignment cases

Signed-off-by: Jongmin Kim <jmkim@debian.org>
This commit is contained in:
Jongmin Kim
2025-03-09 09:50:48 +09:00
parent 0ce457ba71
commit 9bd7bb0392
2 changed files with 2 additions and 8 deletions
+1 -4
View File
@@ -20,10 +20,7 @@ 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
+1 -4
View File
@@ -20,10 +20,7 @@ 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