From 042fef28d2bc8c0e16931f06b49b27dd62b375e9 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Wed, 7 Aug 2024 16:09:02 +1000 Subject: [PATCH] Enable default discovery population under MacOS. --- app/Helpers/network_helper.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Helpers/network_helper.php b/app/Helpers/network_helper.php index 0fae83dba..d92f78cd9 100644 --- a/app/Helpers/network_helper.php +++ b/app/Helpers/network_helper.php @@ -46,6 +46,17 @@ function server_ip() { $ip_address_array = array(); + # MacOS + if (php_uname('s') == 'Darwin') { + $command = "ifconfig | grep inet | grep -v inet6 | grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d'/'"; + exec($command, $output, $return_var); + if ($return_var == 0) { + foreach ($output as $line) { + $ip_address_array[] = trim((string)$line); + } + } + } + # linux if (php_uname('s') == 'Linux') { $command = "ip addr | grep inet | grep -v inet6 | grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d'/'";