From d05719dfffdb6742c34110d20867233b652d5175 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Fri, 29 Jun 2018 02:23:03 +0530 Subject: [PATCH] check debian version for update-alternatives --- scripts/install | 8 ++++++-- scripts/restore | 8 ++++++-- scripts/upgrade | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 6c3bf01..797c351 100755 --- a/scripts/install +++ b/scripts/install @@ -176,5 +176,9 @@ fi #================================================= systemctl reload php7.1-fpm systemctl reload nginx -# Set default php to php7.0 -update-alternatives --set php /usr/bin/php7.0 +# 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 0bd7b89..71f6079 100755 --- a/scripts/restore +++ b/scripts/restore @@ -115,5 +115,9 @@ ynh_restore_file "/etc/cron.d/$app" systemctl reload php7.1-fpm systemctl reload nginx -# Set default php to php7.0 -update-alternatives --set php /usr/bin/php7.0 +# 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 3d0c778..aefe3d8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,5 +147,9 @@ fi #================================================= systemctl reload nginx -# Set default php to php7.0 -update-alternatives --set php /usr/bin/php7.0 +# 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