Skip to content

Commit b31f50e

Browse files
author
Kristan Kenney
committed
Fixes to upgrade script
* Only add webmail alias if mail services are installed * Fix syntax error during global variable detection * Ensure BIN variable is set correctly
1 parent 3acf161 commit b31f50e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

install/upgrade/1.00.0-190618.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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"
67
fi
78

89
# Set backup folder
@@ -23,11 +24,14 @@ if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
2324
fi
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
3135
fi
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
3943
fi
4044

41-
# Load hestia.conf
45+
# Load global variables
4246
source $HESTIA/conf/hestia.conf
4347

4448
# Load hestia main functions

0 commit comments

Comments
 (0)