Add install_composer.sh script

This commit is contained in:
root
2019-08-15 19:45:03 +02:00
parent 86632a9377
commit 3990e03dbd
2 changed files with 20 additions and 0 deletions
+2
View File
@@ -1,3 +1,5 @@
2019-08-15 DariusIII
* Chg: Add install_composer shell script to install latest version of composer
2019-08-14 DariusIII
* Chg: Add and start updating nntmux:resetpp command
2019-08-13 DariusIII
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT