Răsfoiți Sursa

Fix missing mysql packages when installing multiphp stack

- DB_SYSTEM hestia config wasn't set
Robert Zollner 6 ani în urmă
părinte
comite
7faf9efdc0
3 a modificat fișierele cu 42 adăugiri și 5 ștergeri
  1. 6 5
      bin/v-add-web-php
  2. 18 0
      install/hst-install-debian.sh
  3. 18 0
      install/hst-install-ubuntu.sh

+ 6 - 5
bin/v-add-web-php

@@ -55,19 +55,20 @@ check_hestia_demo_mode
 mph="php$version-mbstring php$version-bcmath php$version-cli php$version-curl
      php$version-fpm php$version-gd php$version-intl php$version-mysql
      php$version-soap php$version-xml php$version-zip php$version-mbstring
-     php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql"
+     php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
+     php$version-imap php$version-ldap"
 
 # Check is version is 7.1 or below to add mcrypt
 if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then
     mph="$mph php$version-mcrypt"
 fi
 
-if [ -z "$DB_SYSTEM" -o "$DB_SYSTEM" = "mysql" ]; then
-    mph=$(echo "$mph" | sed -e "s/php$version-pgsql//")
+if ! echo "$DB_SYSTEM" | grep -w 'mysql' >/dev/null; then
+    mph=$(echo "$mph" | sed -e "s/php$version-mysql//")
 fi
 
-if [ -z "$DB_SYSTEM" -o "$DB_SYSTEM" = "pgsql" ]; then
-    mph=$(echo "$mph" | sed -e "s/php$version-mysql//")
+if ! echo "$DB_SYSTEM" | grep -w 'pgsql' >/dev/null; then
+    mph=$(echo "$mph" | sed -e "s/php$version-pgsql//")
 fi
 
 # Install php packages

+ 18 - 0
install/hst-install-debian.sh

@@ -1012,6 +1012,24 @@ else
     fi
 fi
 
+# Database stack
+if [ "$mysql" = 'yes' ]; then
+    installed_db_types='mysql'
+fi
+
+if [ "$pgsql" = 'yes' ]; then
+    installed_db_types="$installed_db_type,pgsql"
+fi
+
+if [ ! -z "$installed_db_types" ]; then
+    db=$(echo "$installed_db_types" |\
+        sed "s/,/\n/g"|\
+        sort -r -u |\
+        sed "/^$/d"|\
+        sed ':a;N;$!ba;s/\n/,/g')
+    echo "DB_SYSTEM='$db'" >> $HESTIA/conf/hestia.conf
+fi
+
 # FTP stack
 if [ "$vsftpd" = 'yes' ]; then
     echo "FTP_SYSTEM='vsftpd'" >> $HESTIA/conf/hestia.conf

+ 18 - 0
install/hst-install-ubuntu.sh

@@ -982,6 +982,24 @@ if [ "$phpfpm" = 'yes' ] || [ "$multiphp" = 'yes' ]; then
     echo "WEB_BACKEND='php-fpm'" >> $HESTIA/conf/hestia.conf
 fi
 
+# Database stack
+if [ "$mysql" = 'yes' ]; then
+    installed_db_types='mysql'
+fi
+
+if [ "$pgsql" = 'yes' ]; then
+    installed_db_types="$installed_db_type,pgsql"
+fi
+
+if [ ! -z "$installed_db_types" ]; then
+    db=$(echo "$installed_db_types" |\
+        sed "s/,/\n/g"|\
+        sort -r -u |\
+        sed "/^$/d"|\
+        sed ':a;N;$!ba;s/\n/,/g')
+    echo "DB_SYSTEM='$db'" >> $HESTIA/conf/hestia.conf
+fi
+
 # FTP stack
 if [ "$vsftpd" = 'yes' ]; then
     echo "FTP_SYSTEM='vsftpd'" >> $HESTIA/conf/hestia.conf