summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-07-05 11:41:27 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-06-05 13:38:38 -0500
commita262ed4c23199e6c42c19dd6fea423d72b78a15a (patch)
tree6d18e6b108934d0b9ac61ae1344508295e41f658 /pm
parent6ff56aa5ec0aa5756162e60b26fd3cbdfb8abcfa (diff)
Make sure that we are root before trying to run dmidecode.
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 4ae6fc6..71dac93 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -85,7 +85,7 @@ done
. "${PM_FUNCTIONS}"
-if command_exists dmidecode; then
+if [ "$(id -u)" = "0" ] && command_exists dmidecode; then
export CHASSIS_TYPE="$(dmidecode -s chassis-type)"
else
export CHASSIS_TYPE=Unknown