From 1f277f38e3d5f15e912d211ee5ad8128e1335a17 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 25 Mar 2020 10:13:41 -0600 Subject: [PATCH] Update functions.php --- resources/functions.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index 9ff465730b..50d8cb2042 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -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'));