aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-03 17:50:30 +0000
committerRoy Marples <roy@marples.name>2008-10-03 17:50:30 +0000
commit4e4c4a5bf4d5c463b79b5648e614b3b780efdbec (patch)
tree3c2d1dd0a7efae19be5d5370f757dd57e941cf86 /init.d
parent09a1a5ecd4561b6120aee56a5db057d46b054b36 (diff)
kenv is not always available.
Diffstat (limited to 'init.d')
-rw-r--r--init.d/hostid.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.d/hostid.in b/init.d/hostid.in
index a0588848..584fd2d7 100644
--- a/init.d/hostid.in
+++ b/init.d/hostid.in
@@ -38,9 +38,11 @@ _set()
# otherwise we generate a random UUID.
reset()
{
- local uuid=$(kenv smbios.system.uuid 2>/dev/null)
- local x="[0-9a-f]"
- local y="${x}${x}${x}${x}"
+ local uuid= x="[0-9a-f]" y="${x}${x}${x}${x}"
+
+ if type kenv >/dev/null 2>&1; then
+ uuid=$(kenv smbios.system.uuid 2>/dev/null)
+ fi
case "${uuid}" in
${y}${y}-${y}-${y}-${y}-${y}${y}${y});;
*) uuid=;;