Skip to content

Instantly share code, notes, and snippets.

@asanikovich
Last active June 4, 2022 01:33
Show Gist options
  • Save asanikovich/4fdfd6e0fc316750fb1d9566fdf004de to your computer and use it in GitHub Desktop.
Save asanikovich/4fdfd6e0fc316750fb1d9566fdf004de to your computer and use it in GitHub Desktop.
test install.sh
#!/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
@asanikovich
Copy link
Author

asanikovich commented Jun 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment