myvesta/bin/v-unsuspend-mail-domains
2016-06-09 16:55:35 +03:00

49 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# info: unsuspend mail domains
# options: USER
#
# The function unsuspends all user's MAIL domains.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'USER'
is_format_valid 'user'
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Starting unsuspend loop
for domain in $(search_objects 'mail' 'SUSPENDED' "yes" 'DOMAIN'); do
$BIN/v-unsuspend-mail-domain "$user" "$domain"
done
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit