Cleanup style by consistently using braces around variable expansion and

apply an addition from Andrew Thompson <thompsa> for filtering out the
special "Nil" UUID (all zeros) which would be a useless host UUID.
This commit is contained in:
Ralf S. Engelschall 2007-05-21 11:57:01 +00:00
parent 3148ce8687
commit e3e421bacf

View File

@ -57,10 +57,14 @@ hostid_set()
hostid_hardware()
{
uuid=`kenv smbios.system.uuid 2>/dev/null`
uuid=`csh -c 'echo -n ${*:al}' "$uuid"`
uuid=`csh -c 'echo -n ${*:al}' "${uuid}"`
x="[0-9a-f]"
y=$x$x$x$x
z="0000"
case "${uuid}" in
$z$z-$z-$z-$z-$z$z$z)
# Filter the special "Nil" UUID
;;
$y$y-$y-$y-$y-$y$y$y)
echo "${uuid}"
;;