Skip to content

Commit 62de766

Browse files
committed
Small fixes in webmail alias change.
1 parent 7333100 commit 62de766

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/v-change-sys-webmail

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ if [ -f /etc/apache2/conf.d/roundcube.conf ]; then
3434
fi
3535

3636
# Get existing nginx webmail alias
37-
if [ -f /etc/nginx/conf.d/roundcube.inc ]; then
37+
if [ -f /etc/nginx/conf.d/webmail.inc ]; then
3838
nginx_webmail=$(cat /etc/nginx/conf.d/webmail.inc | grep "location" | { IFS=' '; read -r -a array; echo "${array[1]}"; })
3939
fi
4040

4141
# Check if alias is different for apache2
42-
if [ -z "$apache_webmail" ]; then
42+
if [ ! -z "$apache_webmail" ]; then
4343
if [ ! "$apache_webmail" = "$WEBMAIL" ]; then
4444
# Replace webmail alias in config files.
45-
sed -i "3/s|Alias $apache_webmail|Alias $WEBMAIL|" /etc/apache2/conf.d/roundcube.conf
45+
sed -i "s|Alias $apache_webmail|Alias $WEBMAIL|" /etc/apache2/conf.d/roundcube.conf
4646

4747
# Restart services
4848
$HESTIA/bin/v-restart-service apache2
4949
fi
5050
fi
5151

5252
# Check if alias is different for nginx
53-
if [ -z "$nginx_webmail" ]; then
53+
if [ ! -z "$nginx_webmail" ]; then
5454
if [ ! "$nginx_webmail" = "$WEBMAIL" ]; then
5555
# Replace webmail alias in config files.
5656
sed -i "s|$nginx_webmail|$WEBMAIL|" /etc/nginx/conf.d/webmail.inc

0 commit comments

Comments
 (0)