Skip to content

Commit bc98234

Browse files
Kristan Kenneyunknown
authored andcommitted
Update v-change-sys-webmail
1 parent b90bdd1 commit bc98234

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

bin/v-change-sys-webmail

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
# Variable&Function #
1010
#----------------------------------------------------------#
1111

12-
# Argument definition
13-
WEBMAIL=$1
14-
1512
# Includes
1613
source $HESTIA/func/main.sh
1714
source $HESTIA/conf/hestia.conf
@@ -23,12 +20,6 @@ export $WEBMAIL_ALIAS
2320
OLD_ALIAS=$WEBMAIL_ALIAS
2421
NEW_ALIAS=$1
2522

26-
#----------------------------------------------------------#
27-
# Verifications #
28-
#----------------------------------------------------------#
29-
30-
check_args '1' "$#" 'WEBMAIL'
31-
3223
#----------------------------------------------------------#
3324
# Action #
3425
#----------------------------------------------------------#
@@ -41,17 +32,17 @@ for user in `ls /usr/local/hestia/data/users/`; do
4132
done
4233

4334
# Set new webmail alias
44-
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' '$NEW_ALIAS'
35+
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' $NEW_ALIAS
4536

4637
for user in `ls /usr/local/hestia/data/users/`; do
4738
for domain in $($BIN/v-list-web-domains $user plain |cut -f 1); do
4839
$BIN/v-add-webmail $user $domain
4940
done
5041
done
5142

52-
# Update alias (non-subdomain) configuration to match
53-
sed -i "s|Alias \/webmail|Alias \/$NEW_ALIAS|gI" /etc/apache2/conf.d/roundcube.conf
54-
sed -i "s|location \/webmail|location \/$NEW_ALIAS|gI" /etc/nginx/conf.d/webmail.inc
43+
# Update global directory alias configuration
44+
sed -i "s|Alias \/$OLD_ALIAS|Alias \/$NEW_ALIAS|gI" /etc/apache2/conf.d/roundcube.conf
45+
sed -i "s|location \/$OLD_ALIAS|location \/$NEW_ALIAS|gI" /etc/nginx/conf.d/webmail.inc
5546

5647
#----------------------------------------------------------#
5748
# Hestia #
@@ -62,7 +53,7 @@ $BIN/v-restart-web $restart
6253
$BIN/v-restart-proxy $restart
6354

6455
# Logging
65-
log_history "changed system webmail alias to $NEW_ALIAS"
56+
log_history "changed global webmail alias to $NEW_ALIAS"
6657
log_event "$OK" "$ARGUMENTS"
6758

6859
exit

0 commit comments

Comments
 (0)