From a16cdd4b3bf33b66187c2413b5a112d0decdd97b Mon Sep 17 00:00:00 2001 From: wienfuchs Date: Fri, 22 May 2020 18:43:29 +0200 Subject: [PATCH] use OS specific ping count parameter --- src/psm/Util/Server/Updater/StatusUpdater.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/psm/Util/Server/Updater/StatusUpdater.php b/src/psm/Util/Server/Updater/StatusUpdater.php index 47d4abf7..a49931c2 100644 --- a/src/psm/Util/Server/Updater/StatusUpdater.php +++ b/src/psm/Util/Server/Updater/StatusUpdater.php @@ -187,7 +187,8 @@ class StatusUpdater } // execute PING - $txt = exec($pingCommand . " -c " . $max_runs . " " . $serverIp . " 2>&1", $output); + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $ping_count = " -n "; else $ping_count = " -c "; + $txt = exec($pingCommand . $ping_count . $max_runs . " " . $serverIp . " 2>&1", $output); // Check if output is PING and if transmitted packets is equal to received packets. preg_match('/^(\d{1,3}) packets transmitted, (\d{1,3}).*$/', $output[count($output) - 2], $output_package_loss);