mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
Update RunRepair.php
This commit is contained in:
parent
0187704576
commit
d7b4206599
1 changed files with 24 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace app\Console\Commands;
|
namespace app\Console\Commands;
|
||||||
|
|
||||||
|
use App\Actions\GetLinuxUser;
|
||||||
use App\ApacheParser;
|
use App\ApacheParser;
|
||||||
use App\Jobs\ApacheBuild;
|
use App\Jobs\ApacheBuild;
|
||||||
use App\Models\Backup;
|
use App\Models\Backup;
|
||||||
|
@ -61,9 +62,30 @@ class RunRepair extends Command
|
||||||
|
|
||||||
public function fixApacheErrors()
|
public function fixApacheErrors()
|
||||||
{
|
{
|
||||||
|
$findHostingSubscriptions = HostingSubscription::get();
|
||||||
|
if ($findHostingSubscriptions) {
|
||||||
|
foreach ($findHostingSubscriptions as $hostingSubscription) {
|
||||||
|
$getLinuxUser = new GetLinuxUser();
|
||||||
|
$getLinuxUser->setUsername($hostingSubscription->system_username);
|
||||||
|
$getLinuxUserStatus = $getLinuxUser->handle();
|
||||||
|
if (!$getLinuxUserStatus) {
|
||||||
|
$findDomains = Domain::where('hosting_subscription_id', $hostingSubscription->id)->get();
|
||||||
|
if ($findDomains) {
|
||||||
|
foreach ($findDomains as $domain) {
|
||||||
|
$domain->status = Domain::STATUS_BROKEN;
|
||||||
|
$domain->saveQuietly();
|
||||||
|
$this->error('Turn on maintenance mode: ' . $domain->domain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->error('User not found: ' . $hostingSubscription->system_username);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Rebuild apache config
|
// Rebuild apache config
|
||||||
// $apacheBuild = new ApacheBuild();
|
$apacheBuild = new ApacheBuild();
|
||||||
// $apacheBuild->handle();
|
$apacheBuild->handle();
|
||||||
|
|
||||||
$checkApacheStatus = shell_exec('service apache2 status');
|
$checkApacheStatus = shell_exec('service apache2 status');
|
||||||
if (strpos($checkApacheStatus, 'Syntax error on line') !== false) {
|
if (strpos($checkApacheStatus, 'Syntax error on line') !== false) {
|
||||||
|
|
Loading…
Reference in a new issue