2013-12-02 13:04:54 -07:00
|
|
|
#!/bin/sh
|
2020-01-22 18:37:27 -07:00
|
|
|
# Return the hardware type of the device
|
2013-12-02 13:04:54 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
SYSINFO=/tmp/sysinfo/hardware_type
|
2013-12-02 13:04:54 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
if [ ! -f $SYSINFO ]; then
|
|
|
|
CFG=/etc/board.json
|
|
|
|
name=""
|
2013-12-02 13:04:54 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
. /usr/share/libubox/jshn.sh
|
2013-12-02 13:04:54 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
[ -f $CFG ] || exit 1
|
|
|
|
json_init
|
|
|
|
json_load "$(cat ${CFG})"
|
|
|
|
json_select model
|
|
|
|
json_get_vars id
|
|
|
|
|
|
|
|
echo "${id##*,}" > $SYSINFO
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat $SYSINFO
|