Browse Source

Drop postfix from the list if exim should not be installed.
Fixes #1995

Raphael Schneeberger 4 years ago
parent
commit
e86c52542f
2 changed files with 16 additions and 2 deletions
  1. 8 1
      install/hst-install-debian.sh
  2. 8 1
      install/hst-install-ubuntu.sh

+ 8 - 1
install/hst-install-debian.sh

@@ -343,7 +343,14 @@ check_result $? "Unable to connect to the Hestia APT repository"
 # Check installed packages
 # Check installed packages
 tmpfile=$(mktemp -p /tmp)
 tmpfile=$(mktemp -p /tmp)
 dpkg --get-selections > $tmpfile
 dpkg --get-selections > $tmpfile
-for pkg in exim4 mariadb-server apache2 nginx hestia postfix; do
+conflicts_pkg="exim4 mariadb-server apache2 nginx hestia postfix"
+
+# Drop postfix from the list if exim should not be installed
+if [ "$exim" = 'no' ]; then
+    conflicts_pkg=$(echo $conflicts_pkg | sed -i 's/postfix//g' | xargs)
+fi
+
+for pkg in $conflicts_pkg; do
     if [ ! -z "$(grep $pkg $tmpfile)" ]; then
     if [ ! -z "$(grep $pkg $tmpfile)" ]; then
         conflicts="$pkg* $conflicts"
         conflicts="$pkg* $conflicts"
     fi
     fi

+ 8 - 1
install/hst-install-ubuntu.sh

@@ -317,7 +317,14 @@ check_result $? "Unable to connect to the Hestia APT repository"
 # Check installed packages
 # Check installed packages
 tmpfile=$(mktemp -p /tmp)
 tmpfile=$(mktemp -p /tmp)
 dpkg --get-selections > $tmpfile
 dpkg --get-selections > $tmpfile
-for pkg in exim4 mariadb-server apache2 nginx hestia postfix ufw; do
+conflicts_pkg="exim4 mariadb-server apache2 nginx hestia postfix ufw"
+
+# Drop postfix from the list if exim should not be installed
+if [ "$exim" = 'no' ]; then
+    conflicts_pkg=$(echo $conflicts_pkg | sed -i 's/postfix//g' | xargs)
+fi
+
+for pkg in $conflicts_pkg; do
     if [ ! -z "$(grep $pkg $tmpfile)" ]; then
     if [ ! -z "$(grep $pkg $tmpfile)" ]; then
         conflicts="$pkg* $conflicts"
         conflicts="$pkg* $conflicts"
     fi
     fi