summaryrefslogtreecommitdiff
path: root/scripts/vyatta-show-dmi
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-28 12:09:43 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-28 12:09:43 -0800
commitfb828c7cf89d964482f1812eec0acd33708b8e0c (patch)
tree6e305d38851c21f2faebc2f57e7bbda3ba2a003a /scripts/vyatta-show-dmi
parentc9d801042d0749c921c7c0f3232df796034889e3 (diff)
downloadvyatta-op-fb828c7cf89d964482f1812eec0acd33708b8e0c.tar.gz
vyatta-op-fb828c7cf89d964482f1812eec0acd33708b8e0c.zip
use sysfs rather dmidecode to look at hardware information
Bugfix: 2896 dmidecode requires sudo access, but using /sys/class/dmi/id/* does not.
Diffstat (limited to 'scripts/vyatta-show-dmi')
-rwxr-xr-xscripts/vyatta-show-dmi15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/vyatta-show-dmi b/scripts/vyatta-show-dmi
new file mode 100755
index 0000000..38233e7
--- /dev/null
+++ b/scripts/vyatta-show-dmi
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ ! -d /sys/class/dmi ]; then
+ echo "DMI information not available"
+ exit 1
+fi
+
+for var in /sys/class/dmi/id/*
+do
+ tag=$(basename $var)
+ if [ -f $var -a -r $var -a $tag != uevent -a $tag != modalias ]; then
+ echo -n "$tag: "
+ cat $var
+ fi
+done