2020-01-22 18:37:27 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# Return the model of the device
|
2013-11-14 23:11:16 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
SYSINFO=/tmp/sysinfo/model
|
2015-04-05 22:58:03 -06:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
if [ ! -f $SYSINFO ]; then
|
|
|
|
CFG=/etc/board.json
|
|
|
|
name=""
|
2016-12-20 19:42:42 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
. /usr/share/libubox/jshn.sh
|
2016-12-20 19:42:42 -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 name
|
2016-12-20 19:42:42 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
echo "$name" > $SYSINFO
|
2016-12-20 19:42:42 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
fi
|
2016-12-20 19:42:42 -07:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
cat $SYSINFO
|