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.

27 lines
534 B

4 years ago
  1. <?php
  2. namespace App\Helpers;
  3. class InstallHelper
  4. {
  5. //
  6. const PACKAGE_STATUS = 'Status: install ok installed';
  7. /**
  8. * check if a packege is installed
  9. *
  10. * @param string $name
  11. * @return boolean
  12. */
  13. public function isReady($name)
  14. {
  15. $result = false;
  16. exec('echo $(dpkg -s nginx 2>&1 | grep "'.self::PACKAGE_STATUS.'")', $output);
  17. if (isset($output[0]) && $output[0] === self::PACKAGE_STATUS) {
  18. $result = true;
  19. }
  20. return $result;
  21. }
  22. }