| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!/bin/bash
- # info: delete webmail support for a domain
- # options: USER DOMAIN [RESTART]
- #
- # The function delete ssl certificates.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Includes
- source $HESTIA/func/main.sh
- source $HESTIA/func/domain.sh
- source $HESTIA/conf/hestia.conf
- # Argument definition
- user=$1
- domain=$2
- restart="$3"
- # Additional argument formatting
- format_domain
- format_domain_idn
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '2' "$#" 'USER DOMAIN'
- is_format_valid 'user' 'domain'
- is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
- is_object_valid 'user' 'USER' "$user"
- is_object_unsuspended 'user' 'USER' "$user"
- is_object_valid 'mail' 'DOMAIN' "$domain"
- is_object_unsuspended 'mail' 'DOMAIN' "$domain"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Delete webmail configuration
- del_webmail_config
- #----------------------------------------------------------#
- # Hestia #
- #----------------------------------------------------------#
- # Restarting web server
- $BIN/v-restart-web $restart
- check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy $restart
- check_result $? "Proxy restart failed" >/dev/null
- # Logging
- log_history "disabled webmail support for $domain"
- log_event "$OK" "$ARGUMENTS"
- exit
|