11#! /bin/bash
22
33# Define global variables
4- if [ -z " $HESTIA " ] || [ ! -f " ${HESTIA} /conf/hestia.conf" ]; then
4+ if [ -z " $HESTIA " ] || [ ! -f " ${HESTIA} /conf/hestia.conf" ]; then
55 export HESTIA=" /usr/local/hestia"
6+ export BIN=" /usr/local/hestia/bin"
67fi
78
89# Set backup folder
@@ -23,11 +24,14 @@ if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
2324fi
2425
2526# Add webmail alias variable to system configuration if non-existent
26- WEBMAIL_ALIAS_CHECK=$( cat $HESTIA /conf/hestia.conf | grep WEBMAIL_ALIAS)
27- if [ -z " $WEBMAIL_ALIAS_CHECK " ]; then
28- echo " (*) Adding global webmail alias to system configuration..."
29- sed -i " /WEBMAIL_ALIAS/d" $HESTIA /conf/hestia.conf
30- echo " WEBMAIL_ALIAS='webmail'" >> $HESTIA /conf/hestia.conf
27+ imap_check=$( cat $HESTIA /conf/hestia.conf | grep IMAP_SYSTEM)
28+ if [ ! -z " $imap_check " ]; then
29+ WEBMAIL_ALIAS_CHECK=$( cat $HESTIA /conf/hestia.conf | grep WEBMAIL_ALIAS)
30+ if [ -z " $WEBMAIL_ALIAS_CHECK " ]; then
31+ echo " (*) Adding global webmail alias to system configuration..."
32+ sed -i " /WEBMAIL_ALIAS/d" $HESTIA /conf/hestia.conf
33+ echo " WEBMAIL_ALIAS='webmail'" >> $HESTIA /conf/hestia.conf
34+ fi
3135fi
3236
3337# Add release branch system configuration if non-existent
@@ -38,7 +42,7 @@ if [ -z "$release_branch_check" ]; then
3842 echo " RELEASE_BRANCH='develop'" >> $HESTIA /conf/hestia.conf
3943fi
4044
41- # Load hestia.conf
45+ # Load global variables
4246source $HESTIA /conf/hestia.conf
4347
4448# Load hestia main functions
0 commit comments