mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 09:54:06 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2022-2023 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||
#
|
||||
# MIT License
|
||||
#
|
||||
|
||||
RES="/usr/share/modemband"
|
||||
|
||||
# modem type
|
||||
getmodem() {
|
||||
|
||||
MDM=$(uci -q get modemband.@modemband[0].modemid)
|
||||
|
||||
if [ "${MDM}" == "" ]; then
|
||||
|
||||
_DEVS=$(awk '/Vendor=/{gsub(/.*Vendor=| ProdID=| Rev.*/,"");print}' /sys/kernel/debug/usb/devices | sort -u)
|
||||
for _DEV in $_DEVS; do
|
||||
if [ -e "$RES/$_DEV" ]; then
|
||||
echo "$_DEV"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
echo "$MDM"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"json")
|
||||
. /usr/share/libubox/jshn.sh
|
||||
json_init
|
||||
json_add_string modem "$(getmodem)"
|
||||
json_add_array
|
||||
json_close_array
|
||||
json_dump
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user