Update functions.php

This commit is contained in:
FusionPBX
2020-03-25 10:13:41 -06:00
committed by GitHub
parent 1692e388d2
commit 1f277f38e3

View File

@@ -104,17 +104,14 @@
if (!function_exists('uuid')) {
function uuid() {
$uuid = null;
$which_uuidgen = shell_exec("which uuidgen");
if (strlen($which_uuidgen) > 0) {
if (PHP_OS === 'FreeBSD') {
$uuid = trim(shell_exec("uuidgen"));
}
if (PHP_OS === 'Linux') {
$uuid = trim(shell_exec("uuidgen -r"));
}
if (!is_uuid($uuid)) {
$uuid = trim(shell_exec("uuidgen"));
}
if (PHP_OS === 'FreeBSD') {
$uuid = trim(shell_exec("uuidgen"));
}
if (PHP_OS === 'Linux') {
$uuid = trim(shell_exec("uuidgen -r"));
}
if (!is_uuid($uuid)) {
$uuid = trim(shell_exec("uuidgen"));
}
if (!is_uuid($uuid) && PHP_OS === 'Linux') {
$uuid = trim(file_get_contents('/proc/sys/kernel/random/uuid'));