feat: use dmi data to generate machine id
This commit is contained in:
parent
78cffa1c12
commit
55b49679f1
|
@ -12,13 +12,13 @@ main() {
|
|||
|
||||
# Accumulate data to create unique machine id
|
||||
local mac_addresses=$(cat /sys/class/net/*/address | uniq | sort)
|
||||
local device_model=$(cat /sys/firmware/devicetree/base/model)
|
||||
local device_uuid=$(dmidecode | grep 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_model" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
|
||||
echo "$mac_adresses $device_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
|
||||
}
|
||||
|
||||
main
|
|
@ -1,3 +1,4 @@
|
|||
luci
|
||||
openssh-server
|
||||
openssh-sftp-server
|
||||
openssh-sftp-server
|
||||
dmidecode
|
Loading…
Reference in New Issue