mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-15 18:02:49 +00:00
12 lines
370 B
Bash
Executable File
12 lines
370 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, so use eth0 mac
|
|
MAC=$(cat /sys/class/net/eth0/address)
|
|
SERIAL_NUM=$(echo "${MAC//:}")
|
|
fi
|
|
|
|
echo $SERIAL_NUM |