aredn/files/usr/local/bin/get_hardwaretype

23 lines
314 B
Bash
Executable File

#!/bin/sh
# Return the hardware type of the device
SYSINFO=/tmp/sysinfo/hardware_type
if [ ! -f $SYSINFO ]; then
CFG=/etc/board.json
name=""
. /usr/share/libubox/jshn.sh
[ -f $CFG ] || exit 1
json_init
json_load "$(cat ${CFG})"
json_select model
json_get_vars id
echo "${id##*,}" > $SYSINFO
fi
cat $SYSINFO