|
|
@@ -1,8 +1,9 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
# Define global variables
|
|
|
-if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf"]; then
|
|
|
+if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf" ]; then
|
|
|
export HESTIA="/usr/local/hestia"
|
|
|
+ export BIN="/usr/local/hestia/bin"
|
|
|
fi
|
|
|
|
|
|
# Set backup folder
|
|
|
@@ -23,11 +24,14 @@ if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
|
|
|
fi
|
|
|
|
|
|
# Add webmail alias variable to system configuration if non-existent
|
|
|
-WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
|
|
|
-if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
|
|
|
- echo "(*) Adding global webmail alias to system configuration..."
|
|
|
- sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
|
|
|
- echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
|
|
|
+imap_check=$(cat $HESTIA/conf/hestia.conf | grep IMAP_SYSTEM)
|
|
|
+if [ ! -z "$imap_check" ]; then
|
|
|
+ WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
|
|
|
+ if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
|
|
|
+ echo "(*) Adding global webmail alias to system configuration..."
|
|
|
+ sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
|
|
|
+ echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
|
|
|
+ fi
|
|
|
fi
|
|
|
|
|
|
# Add release branch system configuration if non-existent
|
|
|
@@ -38,7 +42,7 @@ if [ -z "$release_branch_check" ]; then
|
|
|
echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
|
|
|
fi
|
|
|
|
|
|
-# Load hestia.conf
|
|
|
+# Load global variables
|
|
|
source $HESTIA/conf/hestia.conf
|
|
|
|
|
|
# Load hestia main functions
|