mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Add a directory by kernel instead of a common root, add qnap-301w and rpi4 kernel 6.1 suppport
This commit is contained in:
parent
e910436a7a
commit
46837ec4c0
9459 changed files with 362648 additions and 116345 deletions
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
SECTION="hwinfo"
|
||||
CONFIG="hwinfo"
|
||||
|
||||
get_hw_info() {
|
||||
param=$(/sbin/mnf_info "--name")
|
||||
[ -n "$param" -a ${#param} == 12 ] && uci set "system"."@system[0]"."device_code"=$param
|
||||
|
||||
hostname=${param:0:6}
|
||||
[ -n "$hostname" -a ${#hostname} == 6 -a -z "$(uci -q get system.@system[0].hostname)" ] && uci set "system"."@system[0]"."hostname"=OpenMPTCProuter
|
||||
|
||||
routername=${param:0:6}
|
||||
[ -n "$routername" -a ${#routername} == 6 -a -z "$(uci -q get system.@system[0].routername)" ] && uci set "system"."@system[0]"."routername"=$routername
|
||||
|
||||
version=$(cat /etc/version)
|
||||
[ -n "$version" ] && uci set "system"."@system[0]"."device_fw_version"=$version
|
||||
|
||||
uci commit "system"
|
||||
}
|
||||
|
||||
# get device information
|
||||
echo "Reading device information"
|
||||
get_hw_info
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue