Output the service name only for Linux

FreeBSD adds the service name by default.
This commit is contained in:
FusionPBX
2026-05-12 07:11:29 +00:00
committed by GitHub
parent fa5ae89827
commit 3d357340ae
+8 -8
View File
@@ -572,8 +572,8 @@ class services {
$service_name = preg_replace('/[^a-zA-Z0-9_-]/', '', $service['name']);
// Output to the console
if (PHP_SAPI === 'cli') {
echo " ".$service_name."\n";
if (PHP_SAPI === 'cli' && stristr(PHP_OS, 'Linux')) {
echo $service_name."\n";
}
// Upgrade the service
@@ -642,8 +642,8 @@ class services {
$service_name = preg_replace('/[^a-zA-Z0-9_-]/', '', $service['name']);
// Output to the console
if (PHP_SAPI === 'cli') {
echo " ".$service_name."\n";
if (PHP_SAPI === 'cli' && stristr(PHP_OS, 'Linux')) {
echo $service_name."\n";
}
// Run the start command
@@ -699,8 +699,8 @@ class services {
$service_name = preg_replace('/[^a-zA-Z0-9_-]/', '', $service['name']);
// Output to the console
if (PHP_SAPI === 'cli') {
echo " ".$service_name."\n";
if (PHP_SAPI === 'cli' && stristr(PHP_OS, 'Linux')) {
echo $service_name."\n";
}
// Run the restart command
@@ -752,8 +752,8 @@ class services {
$service_name = preg_replace('/[^a-zA-Z0-9_-]/', '', $service['name']);
// Output to the console
if (PHP_SAPI === 'cli') {
echo " ".$service_name."\n";
if (PHP_SAPI === 'cli' && stristr(PHP_OS, 'Linux')) {
echo $service_name."\n";
}
// Run the stop command