This commit is contained in:
Saeed Vaziry
2023-07-02 12:47:50 +02:00
commit 5c72f12490
825 changed files with 41659 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<?php
namespace App\SSHCommands\ProcessManager\Supervisor;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class CreateWorkerCommand extends Command
{
protected $id;
protected $config;
public function __construct($id, $config)
{
$this->id = $id;
$this->config = $config;
}
public function file(string $os): string
{
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/create-worker.sh'));
}
public function content(string $os): string
{
$command = $this->file($os);
$command = Str::replace('__id__', $this->id, $command);
return Str::replace('__config__', $this->config, $command);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\SSHCommands\ProcessManager\Supervisor;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class DeleteWorkerCommand extends Command
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function file(string $os): string
{
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/delete-worker.sh'));
}
public function content(string $os): string
{
$command = $this->file($os);
return Str::replace('__id__', $this->id, $command);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\SSHCommands\ProcessManager\Supervisor;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class RestartWorkerCommand extends Command
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function file(string $os): string
{
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/restart-worker.sh'));
}
public function content(string $os): string
{
$command = $this->file($os);
return Str::replace('__id__', $this->id, $command);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\SSHCommands\ProcessManager\Supervisor;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class StartWorkerCommand extends Command
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function file(string $os): string
{
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/start-worker.sh'));
}
public function content(string $os): string
{
$command = $this->file($os);
return Str::replace('__id__', $this->id, $command);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\SSHCommands\ProcessManager\Supervisor;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class StopWorkerCommand extends Command
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function file(string $os): string
{
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/stop-worker.sh'));
}
public function content(string $os): string
{
$command = $this->file($os);
return Str::replace('__id__', $this->id, $command);
}
}