File tree Expand file tree Collapse file tree 2 files changed +5
-22
lines changed
Expand file tree Collapse file tree 2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change 1515# Argument definition
1616user=$1
1717domain=$2
18+ restart=${3-yes}
1819
1920# Includes
2021# shellcheck source=/usr/local/hestia/func/main.sh
@@ -69,8 +70,8 @@ if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
6970 if [ ! -z " $IMAP_SYSTEM " ]; then
7071 WEBMAIL=$( get_object_value ' web' ' DOMAIN' " $domain " " $WEBMAIL " )
7172 if [ ! -z " $WEBMAIL " ]; then
72- $BIN /v-delete-mail-domain-webmail $user $domain ' ' $restart ' yes'
73- $BIN /v-add-mail-domain-webmail $user $domain $WEBMAIL ' ' $restart ' yes'
73+ $BIN /v-delete-mail-domain-webmail $user $domain " $restart " ' yes'
74+ $BIN /v-add-mail-domain-webmail $user $domain $WEBMAIL " $restart " ' yes'
7475 fi
7576 fi
7677fi
8182
8283# Update disk usage statistics
8384$BIN /v-update-user-disk $user
85+ $BIN /v-update-user-counters $user
8486
8587# Logging
8688$BIN /v-log-action " system" " Info" " System" " Rebuilt mail domain (User: $user , Domain: $domain )."
Original file line number Diff line number Diff line change @@ -58,35 +58,16 @@ check_hestia_demo_mode
5858# Action #
5959# ----------------------------------------------------------#
6060
61- # Reset counters
62- U_MAIL_DOMAINS=0
63- U_MAIL_DKIM=0
64- U_MAIL_ACCOUNTS=0
65- U_MAIL_SSL=0
66- SUSPENDED_MAIL=0
67- U_DISK_MAIL=0
68-
6961# Starting loop
7062for domain in $( search_objects ' mail' ' SUSPENDED' " *" ' DOMAIN' ) ; do
71- $BIN /v-rebuild-mail-domain $user $domain
63+ $BIN /v-rebuild-mail-domain $user $domain " no "
7264done
7365
7466
7567# ----------------------------------------------------------#
7668# Hestia #
7769# ----------------------------------------------------------#
7870
79- # Updating counters
80- update_user_value " $user " ' $U_MAIL_DOMAINS' " $U_MAIL_DOMAINS "
81- update_user_value " $user " ' $U_MAIL_DKIM' " $U_MAIL_DKIM "
82- update_user_value " $user " ' $U_MAIL_ACCOUNTS' " $U_MAIL_ACCOUNTS "
83- update_user_value " $user " ' $U_MAIL_SSL' " $U_MAIL_SSL "
84- update_user_value " $user " ' $SUSPENDED_MAIL' " $SUSPENDED_MAIL "
85- update_user_value " $user " ' $U_DISK_MAIL' " $U_DISK_MAIL "
86-
87- # Update disk usage statistics
88- $BIN /v-update-user-disk $user
89-
9071# Logging
9172$BIN /v-log-action " system" " Info" " System" " Rebuilt mail domains (User: $user )."
9273log_event " $OK " " $ARGUMENTS "
You can’t perform that action at this time.
0 commit comments