feat(x86): use random uuid to generate machine id
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
Details
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
c9bedc3bf8
commit
ede2142b9f
|
@ -11,14 +11,13 @@ main() {
|
|||
fi
|
||||
|
||||
# Accumulate data to create unique machine id
|
||||
local mac_addresses=$(cat /sys/class/net/*/address | uniq | sort)
|
||||
local device_uuid=$(dmidecode | grep UUID)
|
||||
local random_uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
|
||||
# Ensure destination directory
|
||||
mkdir -p "$(dirname "$machine_id_file")"
|
||||
|
||||
# Generate SHA256 hash of data and save it to $machine_id_file
|
||||
echo "$mac_adresses $device_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
|
||||
echo "$random_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in New Issue