Skip to content

Commit

Permalink
🩹 restore cpu serial for rpi
Browse files Browse the repository at this point in the history
  • Loading branch information
wade ~ Pack3tL0ss committed Dec 4, 2024
1 parent 050aa0a commit fd64d9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pypkg/consolepi/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def get_cpu_serial(self):
if res[0] > 0:
log.warning('Unable to get unique identifier for this pi (cpuserial)', show=True)
return 0
elif not res[1]:
elif res[1]:
return res[1]
else: # for non rpi use machine-id if file exists
machine_id_file = Path("/etc/machine-id")
if machine_id_file.exists():
return machine_id_file.read_text().strip()
Expand Down

0 comments on commit fd64d9a

Please sign in to comment.