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
695 B

4 years ago
  1. #!/usr/bin/env bash
  2. #
  3. #
  4. #
  5. set -o errexit
  6. set -o pipefail
  7. set -o nounset
  8. _hash=${1:-}
  9. if [ -z "${_hash}" ]; then
  10. echo -e "\$1 is required, please check on https://composer.github.io/pubkeys.html"
  11. exit 0
  12. fi
  13. # installing dependencies
  14. apt install -y curl php-cli php-mbstring php-dom git unzip
  15. # download installer
  16. curl -sS https://getcomposer.org/installer -o composer-setup.php
  17. # check hash
  18. php -r "if (hash_file('SHA384', 'composer-setup.php') === '$_hash') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  19. php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  20. # remove installer
  21. rm composer-setup.php