OpenSource CLI-App to install and handle stuff related to Web-Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.2 KiB

<?php
namespace App\Commands;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use Illuminate\Support\Facades\File;
use App\Facades\Install;
use Log;
class LetsEncryptInstallCommand extends Command
{
/**
* The signature of the command.
*
* @var string
*/
protected $signature = 'lets-encrypt:install';
/**
* The description of the command.
*
* @var string
*/
protected $description = 'Install LetsEncrypt';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->info('LetsEncrypt install...');
exec('apt update 2>&1');
exec('apt-get install software-properties-common 2>&1');
exec('add-apt-repository universe 2>&1');
exec('add-apt-repository ppa:certbot/certbot 2>&1');
exec('apt-get update 2>&1');
exec('apt-get install certbot python3-certbot-nginx 2>&1');
if (Install::isReady('certbot')) {
// get status of nginx
exec('nginx -v 2>&1', $output);
$status = "$output[0] installed";
$this->info($status);
Log::info($status);
}
}
}