Last active
June 4, 2022 01:33
-
-
Save asanikovich/4fdfd6e0fc316750fb1d9566fdf004de to your computer and use it in GitHub Desktop.
test install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if which php; then | |
currentVersion = $(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,3) | |
if [ $(echo "$currentVersion >= 80" | bc) -eq 1 ]; then | |
echo "PHP Version is valid ..."; | |
else | |
sudo apt update && sudo apt install php8.1-cli -y < "/dev/null" | |
fi | |
else | |
sudo apt update && sudo apt install php8.1-cli -y < "/dev/null" | |
fi | |
bash_profile=$HOME/.bash_profile | |
if [ -f "$bash_profile" ]; then | |
. $HOME/.bash_profile | |
fi | |
cd $HOME | |
git clone -q https://github.com/laravel/installer.git test | |
cd test | |
wget -q https://getcomposer.org/download/latest-stable/composer.phar | |
php composer.phar install -q --no-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
wget -q -O test.sh https://gist.githubusercontent.com/allok/4fdfd6e0fc316750fb1d9566fdf004de/raw/f6f62d92b28cf6f71524d029e3f286343834d487/install.sh && chmod +x test.sh && sudo /bin/bash test.sh