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.

51 lines
1.1 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Commands;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use LaravelZero\Framework\Commands\Command;
  5. /**
  6. *
  7. *
  8. *
  9. */
  10. class LetsEncryptInstallCommand extends Command
  11. {
  12. /**
  13. * The signature of the command.
  14. *
  15. * @var string
  16. */
  17. protected $signature = 'lets-encrypt:install';
  18. /**
  19. * The description of the command.
  20. *
  21. * @var string
  22. */
  23. protected $description = 'Install LetsEncrypt for nginx';
  24. /**
  25. * Execute the console command.
  26. *
  27. * @return mixed
  28. */
  29. public function handle()
  30. {
  31. $this->info('LetsEncrypt installing...');
  32. exec('apt update 2>&1');
  33. exec('apt-get install software-properties-common 2>&1');
  34. exec('add-apt-repository universe 2>&1');
  35. exec('add-apt-repository ppa:certbot/certbot 2>&1');
  36. exec('apt-get update 2>&1');
  37. exec('apt-get install certbot python3-certbot-nginx 2>&1');
  38. if (Install::isReady('certbot')) {
  39. $this->info('LetsEncrypt installing...Success! \o/');
  40. } else {
  41. $this->error("Failed! Please check log-file!");
  42. }
  43. }
  44. }