1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Add tools for RUTX platform on 6.1 kernel

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-10-03 10:12:57 +02:00
parent f9d849ae11
commit 34d19875d7
34 changed files with 4894 additions and 0 deletions

View file

@ -0,0 +1,54 @@
. /usr/share/libubox/jshn.sh
# when device contains 2 internal modems, this function will return '2' if
# selected modem(inc_id) is builtin and primary.
# And if it's only builtin, then '1'
is_builtin_modem() {
local inc_id="$1"
local modem modems id builtin primary
json_init
json_load_file "/etc/board.json"
json_get_keys modems modems
json_select modems
for modem in $modems; do
json_select "$modem"
json_get_vars id builtin primary
[ "$id" = "$inc_id" ] && {
[ -n "$builtin" ] && {
[ -n "$primary" ] && {
echo 2
return
}
echo 1
return
}
echo 0
return
}
json_select ..
done
echo 0
}
is_dual_modem() {
json_init
json_load_file "/etc/board.json"
json_get_keys hwinfo hwinfo
json_select hwinfo
json_get_vars dual_modem
[ "$dual_modem" = "1" ] && echo 1 || echo 0
json_select ..
}