2015-05-05 17:18:24 -06:00
|
|
|
#!/bin/sh
|
2020-01-22 18:37:27 -07:00
|
|
|
# Return the boardid of the device
|
2015-05-05 17:18:24 -06:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
SYSINFO=/tmp/sysinfo/boardid
|
2015-05-05 17:18:24 -06:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
if [ ! -f $SYSINFO ]; then
|
|
|
|
name=""
|
2015-05-05 17:18:24 -06:00
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
if [ "$(/usr/local/bin/get_hardware_mfg)" = "Ubiquiti" ]; then
|
|
|
|
[ -f "/sys/devices/pci0000:00/0000:00:00.0/subsystem_device" ] &&
|
|
|
|
name="$(cat /sys/devices/pci0000:00/0000:00:00.0/subsystem_device)"
|
|
|
|
[ "$name" = "0x0000" -o -z $name ] &&
|
|
|
|
name="0x$(dd if=/dev/mtd7 bs=1 skip=12 count=2 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"')"
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ "$name" = "0x0000" -o -z $name ] && name="$(/usr/local/bin/get_model)"
|
|
|
|
|
|
|
|
echo "$name" > $SYSINFO
|
2015-05-05 17:18:24 -06:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2020-01-22 18:37:27 -07:00
|
|
|
cat $SYSINFO
|