Skip to content

Commit a35cf46

Browse files
author
Kristan Kenney
committed
Minor fixes in v-change-sys-webmail
Fix incorrect options comment Check for webmail.inc before modifying it
1 parent 1839ceb commit a35cf46

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/v-change-sys-webmail

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: change webmail alias url
3-
# options: USER DOMAIN
3+
# options: WEBMAIL
44
#
55
# This function changes the webmail url in apache2 or nginx configuration.
66

@@ -34,6 +34,7 @@ done
3434
# Set new webmail alias
3535
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' $NEW_ALIAS
3636

37+
# Add new webmail configuration
3738
for user in `ls /usr/local/hestia/data/users/`; do
3839
for domain in $($BIN/v-list-mail-domains $user plain |cut -f 1); do
3940
$BIN/v-add-sys-webmail $user $domain
@@ -44,8 +45,9 @@ done
4445
if [ "$WEB_SYSTEM" = "apache2" ]; then
4546
sed -i "s|Alias \/$OLD_ALIAS|Alias \/$NEW_ALIAS|gI" /etc/apache2/conf.d/roundcube.conf
4647
fi
47-
48-
sed -i "s|location \/$OLD_ALIAS|location \/$NEW_ALIAS|gI" /etc/nginx/conf.d/webmail.inc
48+
if [ -e "/etc/nginx/conf.d/webmail.inc" ]; then
49+
sed -i "s|location \/$OLD_ALIAS|location \/$NEW_ALIAS|gI" /etc/nginx/conf.d/webmail.inc
50+
fi
4951

5052
#----------------------------------------------------------#
5153
# Hestia #

0 commit comments

Comments
 (0)