Skip to content

Commit 1ff34ce

Browse files
author
Kristan Kenney
committed
Add WEBMAIL_ALIAS variable only if it doesn't exist during upgrade
1 parent a023dad commit 1ff34ce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

install/upgrade/0.10.0-190430.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ HESTIA="/usr/local/hestia"
55
HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
66
hestiacp="$HESTIA/install/deb"
77

8-
# Add webmail alias variable to system configuration
9-
sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
10-
echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
8+
# Add webmail alias variable to system configuration if non-existent
9+
webmail_alias_check=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
10+
if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
11+
echo "(*) Adding global webmail alias to system configuration..."
12+
sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
13+
echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
14+
fi
1115

1216
# load hestia.conf
1317
source $HESTIA/conf/hestia.conf

0 commit comments

Comments
 (0)