summaryrefslogtreecommitdiff
path: root/src/edu/stsci/OSInfo.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/edu/stsci/OSInfo.groovy')
-rw-r--r--src/edu/stsci/OSInfo.groovy19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/edu/stsci/OSInfo.groovy b/src/edu/stsci/OSInfo.groovy
new file mode 100644
index 0000000..04375f8
--- /dev/null
+++ b/src/edu/stsci/OSInfo.groovy
@@ -0,0 +1,19 @@
+package org.stsci
+
+class OSInfo implements Serializable {
+ public String name
+ public String version
+ public String arch
+
+ OSInfo () {
+ name = 'uname -s'.execute().text.trim()
+ if (name == 'Darwin') { name = 'MacOSX' }
+ arch = 'uname -m'.execute().text.trim()
+ if (arch.matches('^i.*86$')) { arch = 'x86' }
+
+ this.name = name
+ this.arch = arch
+ this.version = 'uname -r'.execute().text.trim()
+ }
+
+}