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.
 
 
 

28 lines
695 B

#!/usr/bin/env bash
#
#
#
set -o errexit
set -o pipefail
set -o nounset
_hash=${1:-}
if [ -z "${_hash}" ]; then
echo -e "\$1 is required, please check on https://composer.github.io/pubkeys.html"
exit 0
fi
# installing dependencies
apt install -y curl php-cli php-mbstring php-dom git unzip
# download installer
curl -sS https://getcomposer.org/installer -o composer-setup.php
# check hash
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$_hash') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
# remove installer
rm composer-setup.php