Skip to content

Commit

Permalink
fix: WinRM service status
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Oct 11, 2023
1 parent 846aca6 commit ecd2961
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions app/Http/Controllers/API/Server/DetailsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public function specs()
* @return Application|Factory|View
*
* @throws GuzzleException
* @throws GuzzleException
*/
public function topCpuProcesses()
{
Expand All @@ -209,7 +208,6 @@ public function topCpuProcesses()
* @return Application|Factory|View
*
* @throws GuzzleException
* @throws GuzzleException
*/
public function topMemoryProcesses()
{
Expand All @@ -234,7 +232,6 @@ public function topMemoryProcesses()
* @return Application|Factory|View
*
* @throws GuzzleException
* @throws GuzzleException
*/
public function topDiskUsage()
{
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/API/Server/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __construct()
*/
public function getLocalUsers()
{
$users = [];
if (server()->isLinux()) {
$output = Command::runSudo(
"cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1"
Expand All @@ -50,7 +51,7 @@ public function getLocalUsers()
}

if (server()->isWindows() && server()->canRunCommand()) {
$output = Command::runSudo(
$output = Command::run(
'Get-LocalUser | Where { $_.Enabled -eq $True} | Select-Object Name'
);
$output = trim($output);
Expand Down Expand Up @@ -113,6 +114,7 @@ public function addLocalUser()
*/
public function getLocalGroups()
{
$groups = [];
if (server()->isLinux()) {
$output = Command::runSudo("getent group | cut -d ':' -f1");
$output = trim($output);
Expand All @@ -130,7 +132,7 @@ public function getLocalGroups()
}

if (server()->isWindows() && server()->canRunCommand()) {
$output = Command::runSudo(
$output = Command::run(
'Get-LocalGroup | Select-Object Name'
);
$output = trim($output);
Expand Down

0 comments on commit ecd2961

Please sign in to comment.