summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/system.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index c7c6be2..ed93d0f 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2345,6 +2345,24 @@ function system_get_serial() {
return get_single_sysctl('kern.hostuuid');
}
+function system_get_uniqueid() {
+ global $g;
+
+ $uniqueid_file="{$g['vardb_path']}/uniqueid";
+
+ if (empty($g['uniqueid'])) {
+ if (!file_exists($uniqueid_file)) {
+ mwexec("/usr/sbin/gnid > {$g['vardb_path']}/uniqueid " .
+ "2>/dev/null");
+ }
+ if (file_exists($uniqueid_file)) {
+ $g['uniqueid'] = @file_get_contents($uniqueid_file);
+ }
+ }
+
+ return ($g['uniqueid'] ?: '');
+}
+
/*
* attempt to identify the specific platform (for embedded systems)
* Returns an array with two elements:
OpenPOWER on IntegriCloud