mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-28 15:31:37 +00:00
17 lines
548 B
Bash
Executable File
17 lines
548 B
Bash
Executable File
#!/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
|
|
# 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
|
|
fi
|
|
|
|
echo $SERIAL_NUM |