2020-07-10 03:57:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SERIAL_NUM=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2)
|
|
|
|
if [[ "$SERIAL_NUM" == "" ]]; then
|
|
|
|
SERIAL_NUM=$(sudo dmidecode | grep UUID | cut -d ' ' -f 2)
|
|
|
|
elif [[ "$SERIAL_NUM" == "0000000000000000" ]]; then
|
2021-02-26 05:24:56 +00:00
|
|
|
# RockPro64 returns 0s
|
|
|
|
if [ -f /home/bitcoin/.mynode/mynode_serial ]; then
|
|
|
|
SERIAL_NUM=$(cat /home/bitcoin/.mynode/mynode_serial)
|
|
|
|
else
|
|
|
|
# Backup, use eth0 mac (some are duplicate?)
|
|
|
|
MAC=$(cat /sys/class/net/eth0/address)
|
|
|
|
SERIAL_NUM=$(echo "${MAC//:}")
|
|
|
|
fi
|
2020-07-10 03:57:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo $SERIAL_NUM
|