Skip to content

Commit f6159de

Browse files
author
manuelserol
authored
Check if sieve is already installed (hestiacp#2719)
If sieve is already installed and install_sieve.sh is executed, a duplicate block of "dovecot_virtual_delivery" was added to /etc/exim4/exim.conf.template causing an error when restarting exim4 service An if statement was added to exit the script in case that block already exists
1 parent e1e095a commit f6159de

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

install/upgrade/manual/install_sieve.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ source $HESTIA/func/main.sh
1616
source_conf "$HESTIA/conf/hestia.conf"
1717
source_conf "$HESTIA/install/upgrade/upgrade.conf"
1818

19+
#----------------------------------------------------------#
20+
# Verifications #
21+
#----------------------------------------------------------#
22+
23+
#check if string already exists
24+
if grep "dovecot_virtual_delivery" /etc/exim4/exim4.conf.template; then
25+
echo "Plugin allready enabled"
26+
exit 0
27+
fi
28+
29+
#----------------------------------------------------------#
30+
# Action #
31+
#----------------------------------------------------------#
32+
1933
HAS_DOVECOT_SIEVE_INSTALLED=`dpkg --get-selections dovecot-sieve | grep dovecot-sieve | wc -l`
2034

2135
# Folder paths
@@ -110,4 +124,4 @@ else
110124
systemctl restart dovecot > /dev/null 2>&1
111125
systemctl restart exim4 > /dev/null 2>&1
112126
fi
113-
fi
127+
fi

0 commit comments

Comments
 (0)