mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Add files needed for RUTX
This commit is contained in:
parent
9ddca33019
commit
b5d6a2ecb4
34 changed files with 4352 additions and 0 deletions
40
6.1/target/linux/ipq40xx/base-files/lib/functions/board.sh
Normal file
40
6.1/target/linux/ipq40xx/base-files/lib/functions/board.sh
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
. /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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue