diff options
Diffstat (limited to 'hook/hostname')
-rw-r--r-- | hook/hostname | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hook/hostname b/hook/hostname index 07c8be6..e37e90c 100644 --- a/hook/hostname +++ b/hook/hostname @@ -8,8 +8,8 @@ run_latehook() { if [[ -n "${hostname}" ]]; then msg ":: Setting hostname for main system to '${hostname}'..." elif [[ -e /sys/class/dmi/id/product_uuid ]]; then - msg ":: Setting hostname to first bits of product uuid..." - hostname="$(cut -d- -f1 < /sys/class/dmi/id/product_uuid)" + msg ":: Setting hostname from product uuid..." + hostname="$(sha1sum < /sys/class/dmi/id/product_uuid | cut -c1-8)" else msg ":: Setting hostname to random string..." hostname="$(cut -d- -f1 < /proc/sys/kernel/random/boot_id)" |