diff options
author | rse <rse@FreeBSD.org> | 2007-05-21 11:57:01 +0000 |
---|---|---|
committer | rse <rse@FreeBSD.org> | 2007-05-21 11:57:01 +0000 |
commit | 9af56a3ee664f965607d695799f8e554cbed4a1a (patch) | |
tree | a97c2a36b6028e951e3db0f21f5b57e96b6241db /etc | |
parent | 0860e323d57b3a627e1d9cc204cff9e86ef5f4e2 (diff) | |
download | FreeBSD-src-9af56a3ee664f965607d695799f8e554cbed4a1a.zip FreeBSD-src-9af56a3ee664f965607d695799f8e554cbed4a1a.tar.gz |
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.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.d/hostid | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/rc.d/hostid b/etc/rc.d/hostid index 9a6d39f..181870c 100644 --- a/etc/rc.d/hostid +++ b/etc/rc.d/hostid @@ -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}" ;; |