From 52d6a97c2192f708c02d55a18237e8102fd19ee3 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Fri, 29 Jun 2018 02:56:05 +0530 Subject: [PATCH] check debian version and set php version --- scripts/install | 6 ++++++ scripts/restore | 6 ++++++ scripts/upgrade | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/scripts/install b/scripts/install index 475a87d..0356111 100755 --- a/scripts/install +++ b/scripts/install @@ -170,3 +170,9 @@ fi #================================================= systemctl reload php7.1-fpm systemctl reload nginx +# Set default php to php5 or php7.0 +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + update-alternatives --set php /usr/bin/php5 +else + update-alternatives --set php /usr/bin/php7.0 +fi diff --git a/scripts/restore b/scripts/restore index fe317c1..c27e745 100755 --- a/scripts/restore +++ b/scripts/restore @@ -113,3 +113,9 @@ cd $final_path && sudo /usr/bin/php7.1 artisan passport:install systemctl reload php7.1-fpm systemctl reload nginx +# Set default php to php5 or php7.0 +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + update-alternatives --set php /usr/bin/php5 +else + update-alternatives --set php /usr/bin/php7.0 +fi diff --git a/scripts/upgrade b/scripts/upgrade index 673b571..f3ecdff 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -184,3 +184,9 @@ fi #================================================= systemctl reload php7.1-fpm systemctl reload nginx +# Set default php to php5 or php7.0 +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + update-alternatives --set php /usr/bin/php5 +else + update-alternatives --set php /usr/bin/php7.0 +fi