-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
244b697
commit fb32352
Showing
4 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Modules\Email\App\Services; | ||
|
||
class EmailService | ||
{ | ||
public function restartService(string $serviceName): string | ||
{ | ||
$output = shell_exec("sudo systemctl restart $serviceName"); | ||
return $output ? trim($output) : "$serviceName restarted successfully."; | ||
} | ||
public function stopService(string $serviceName): string | ||
{ | ||
$output = shell_exec("sudo systemctl stop $serviceName"); | ||
return $output ? trim($output) : "$serviceName stopped successfully."; | ||
} | ||
public function startService(string $serviceName): string | ||
{ | ||
$output = shell_exec("sudo systemctl start $serviceName"); | ||
return $output ? trim($output) : "$serviceName started successfully."; | ||
} | ||
} | ||
|