File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# info: change webmail alias url
3- # options: WEBMAIL
3+ # options: USER DOMAIN
44#
55# This function changes the webmail url in apache2 or nginx configuration.
66
@@ -26,7 +26,7 @@ NEW_ALIAS=$1
2626
2727# Delete old webmail configuration
2828for user in ` ls /usr/local/hestia/data/users/` ; do
29- for domain in $( $BIN /v-list-web -domains $user plain | cut -f 1) ; do
29+ for domain in $( $BIN /v-list-mail -domains $user plain | cut -f 1) ; do
3030 $BIN /v-delete-sys-webmail $user $domain
3131 done
3232done
3535$BIN /v-change-sys-config-value ' WEBMAIL_ALIAS' $NEW_ALIAS
3636
3737for user in ` ls /usr/local/hestia/data/users/` ; do
38- for domain in $( $BIN /v-list-web -domains $user plain | cut -f 1) ; do
38+ for domain in $( $BIN /v-list-mail -domains $user plain | cut -f 1) ; do
3939 $BIN /v-add-sys-webmail $user $domain
4040 done
4141done
4242
4343# Update global directory alias configuration
44- sed -i " s|Alias \/$OLD_ALIAS |Alias \/$NEW_ALIAS |gI" /etc/apache2/conf.d/roundcube.conf
44+ if [ " $WEB_SYSTEM " = " apache2" ]; then
45+ sed -i " s|Alias \/$OLD_ALIAS |Alias \/$NEW_ALIAS |gI" /etc/apache2/conf.d/roundcube.conf
46+ fi
47+
4548sed -i " s|location \/$OLD_ALIAS |location \/$NEW_ALIAS |gI" /etc/nginx/conf.d/webmail.inc
4649
4750# ----------------------------------------------------------#
You can’t perform that action at this time.
0 commit comments