mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-14 20:48:17 +08:00
🎉 Sync 2026-11-13 03:15:01
This commit is contained in:
1 parent
db03d04b97
commit
7f7e02b085
59 files changed
+1601
-1280
No files matched your search
+51
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2025 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
# (c) 2025-2026 modified by Rafał Wabik - IceG - From eko.one.pl forum
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
ECM=""
|
||||
|
||||
RES="/usr/share/modemdata"
|
||||
|
||||
device=$1
|
||||
network=$2
|
||||
forced_plmn=$3
|
||||
|
||||
try_params_mm() {
|
||||
local retries=5
|
||||
local delay=1
|
||||
local i
|
||||
local result
|
||||
|
||||
for i in $(seq 1 $retries); do
|
||||
result=$($RES/params_modemmanager.sh "$device" "$forced_plmn")
|
||||
if [ -n "$result" ]; then
|
||||
echo "$result"
|
||||
return 0
|
||||
fi
|
||||
sleep "$delay"
|
||||
done
|
||||
echo "{}"
|
||||
}
|
||||
|
||||
SEPARATOR=""
|
||||
parse_section() {
|
||||
echo "["
|
||||
$RES/product_modemmanager.sh "$device"
|
||||
echo ","
|
||||
$RES/network.sh "$network"
|
||||
echo ","
|
||||
try_params_mm
|
||||
echo "]"
|
||||
}
|
||||
|
||||
config_load modemdata
|
||||
parse_section modemdata
|
||||
|
||||
exit 0
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2025 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
# (c) 2025-2026 modified by Rafał Wabik - IceG - From eko.one.pl forum
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
ECM=""
|
||||
|
||||
RES="/usr/share/modemdata"
|
||||
|
||||
device=$1
|
||||
network=$2
|
||||
forced_plmn=$3
|
||||
|
||||
SEPARATOR=""
|
||||
parse_section() {
|
||||
|
||||
if echo "x$device" | grep -q "192.168."; then
|
||||
ECM="$RES/addon/ecm/huawei.sh $device"
|
||||
else
|
||||
ECM=""
|
||||
fi
|
||||
echo "["
|
||||
if [ -n "$ECM" ]; then
|
||||
$ECM product
|
||||
echo ","
|
||||
$RES/network.sh "$network"
|
||||
echo ","
|
||||
$ECM params
|
||||
else
|
||||
$RES/product.sh "$device"
|
||||
echo ","
|
||||
$RES/network.sh "$network"
|
||||
echo ","
|
||||
$RES/params.sh "$device" "$forced_plmn"
|
||||
fi
|
||||
echo "]"
|
||||
}
|
||||
|
||||
config_load modemdata
|
||||
parse_section modemdata
|
||||
|
||||
exit 0
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2025 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
# (c) 2025-2026 modified by Rafał Wabik - IceG - From eko.one.pl forum
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
RES="/usr/share/modemdata"
|
||||
|
||||
device=$1
|
||||
network=$2
|
||||
forced_plmn=$3
|
||||
mbim=$4
|
||||
|
||||
try_params_uqmi() {
|
||||
local retries=5
|
||||
local delay=1
|
||||
local i
|
||||
local result
|
||||
|
||||
for i in $(seq 1 $retries); do
|
||||
result=$($RES/params_qmi.sh "$device" "$forced_plmn" "$mbim")
|
||||
if [ -n "$result" ]; then
|
||||
echo "$result"
|
||||
return 0
|
||||
fi
|
||||
sleep "$delay"
|
||||
done
|
||||
echo "{}"
|
||||
}
|
||||
|
||||
SEPARATOR=""
|
||||
parse_section() {
|
||||
echo "["
|
||||
$RES/product.sh "$device"
|
||||
echo ","
|
||||
$RES/network.sh "$network"
|
||||
echo ","
|
||||
try_params_uqmi
|
||||
echo "]"
|
||||
}
|
||||
|
||||
config_load modemdata
|
||||
parse_section modemdata
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"admin/modem": {
|
||||
"title": "Modem",
|
||||
"order": 30,
|
||||
"action": {
|
||||
"type": "firstchild",
|
||||
"recurse": true
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata": {
|
||||
"title": "Modemdata Status",
|
||||
"order": 10,
|
||||
"action": {
|
||||
"type": "alias",
|
||||
"path": "admin/modem/modemdata/modempreview"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-modemdata" ],
|
||||
"uci": { "modemdata": true }
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata/modempreview": {
|
||||
"title": "Modem(s)",
|
||||
"order": 10,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "modem/modempreview"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata/modemdiagnostics": {
|
||||
"title": "Diagnostics",
|
||||
"order": 20,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "modem/modemdiagnostics"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata/modemdefine": {
|
||||
"title": "Modem(s) configuration",
|
||||
"order": 30,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "modem/modemdefine"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata/modemconfig": {
|
||||
"title": "Package configuration",
|
||||
"order": 40,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "modem/modemconfig"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/modem/modemdata/modemupdate": {
|
||||
"title": "Package update and support",
|
||||
"order": 50,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "modem/modemupdate"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"luci-app-modemdata": {
|
||||
"description": "Grant access to LuCI JS app modemdata",
|
||||
"read": {
|
||||
"cgi-io": [ "exec" ],
|
||||
"file": {
|
||||
"/usr/share/modemdata/network.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/params.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/params_modemmanager.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/params_qmi.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/product.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/product_modemmanager.sh": [ "exec" ],
|
||||
"/usr/share/modemdata/addon/ecm/huawei.sh": [ "exec" ],
|
||||
"/usr/bin/mmcli": [ "exec" ],
|
||||
"/bin/sh": [ "exec" ],
|
||||
"/usr/bin/md_serial_ecm": [ "exec" ],
|
||||
"/usr/bin/md_modemmanager": [ "exec" ],
|
||||
"/usr/bin/md_uqmi": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/network.sh": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/params.sh": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/params_modemmanager.sh": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/product.sh": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/product_modemmanager.sh": [ "exec" ],
|
||||
"/bin/sh -x /usr/share/modemdata/addon/ecm/huawei.sh": [ "exec" ],
|
||||
"/tmp/debug_result.txt": [ "read" ],
|
||||
"/etc/modemdata": [ "read" ],
|
||||
"/sys/kernel/debug/usb/devices": [ "read" ],
|
||||
"/dev": [ "list" ],
|
||||
"/etc/defmodems": [ "read" ],
|
||||
"/etc/modem/modemlist.json": [ "read" ],
|
||||
"/bin/uclient-fetch": [ "exec" ],
|
||||
"/usr/libexec/package-manager-call list-installed": [ "exec" ],
|
||||
"/usr/libexec/opkg-list installed": [ "exec" ],
|
||||
"/usr/libexec/opkg-call list-installed": [ "exec" ],
|
||||
"/etc/opkg.conf": [ "read" ]
|
||||
},
|
||||
"uci": [ "modemdata" , "defmodems" ]
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/bin/cat": [ "exec" ],
|
||||
"/bin/sh": [ "exec" ],
|
||||
"/bin/uclient-fetch": [ "exec" ],
|
||||
"/bin/ls /dev": [ "exec" ],
|
||||
"/bin/sh /usr/bin/md_serial_ecm": [ "exec" ],
|
||||
"/etc/defmodems": [ "write" ],
|
||||
"/tmp/debug_result.txt": [ "write" ],
|
||||
"/etc/modemdata": [ "write" ],
|
||||
"/etc/modem/modemlist.json": [ "write" ]
|
||||
},
|
||||
"uci": [ "modemdata" , "defmodems" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user