summaryrefslogtreecommitdiff
path: root/bin
diff options
authorrod.smith <rod.smith@canonical.com>2014-07-17 22:36:47 +0000
committerDaniel Manrique <>2014-07-17 22:36:47 +0000
commitdeb9880a80f2cbd75f5b8f269736eb2e0f23353b (patch)
treeda154c3552149669ddd6b3e93bdbdfa32deca24d /bin
parentbdc207ba438e4a16efb2c7168ea69882ea400366 (diff)
parent0fe1d9d035aa70ed3ae3ab5e9f955c4aecbabae1 (diff)
"automatic merge by tarmac [r=zkrynicki][bug=][author=rodsmith]"
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get_make_and_model18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/get_make_and_model b/bin/get_make_and_model
new file mode 100755
index 0000000..f21e6eb
--- /dev/null
+++ b/bin/get_make_and_model
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+import os.path
+
+def print_file_contents(heading, filename):
+ with open(filename) as f:
+ text = f.read().strip()
+ print("{}: {}".format(heading, text))
+ f.close()
+
+def main():
+ print_file_contents('Manufacturer', '/sys/class/dmi/id/sys_vendor')
+ print_file_contents('Model', '/sys/class/dmi/id/product_name')
+ print_file_contents('Version', '/sys/class/dmi/id/product_version')
+
+if __name__ == "__main__":
+ raise SystemExit(main())
+