fcc-unlock: Reduce the port assignment cases
Signed-off-by: Jongmin Kim <jmkim@debian.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user