#!/bin/bash SERIAL_NUM="UNKNOWN" BACKUP_SERIAL="UNKNOWN_BACKUP" if [ -f /home/bitcoin/.mynode/mynode_serial ]; then BACKUP_SERIAL=$(cat /home/bitcoin/.mynode/mynode_serial) else # Backup, use eth0 mac (some are duplicate?) if [ -f /sys/class/net/eth0/address ]; then MAC=$(cat /sys/class/net/eth0/address) BACKUP_SERIAL=$(echo "${MAC//:}") else BACKUP_SERIAL="UNKNOWN_BACKUP_SERIAL" fi fi if [ -f /sys/firmware/devicetree/base/serial-number ]; then SERIAL_NUM=$(tr -d '\0'